
Something like this would work.
Problem is if you want 12v at 500mA and 5v at 500mA, the U1 regulator needs to produce at least 1A of current, to give 500mA to the 5v regulator... so you must pock a suitable capacitor before the 12v regulator to keep the minimum voltage above the output voltage + voltage drop (1v..1.5v)
Also keep in mind the 5v regulator will dissipate a lot of heat, you'd be dealing with (12v - 5v) x 0.5a = 3.5 watts.
You could split the heat by adding a 9v regulator between the 12v and 5v one... a 7809 is cheap.
Alternatively, you could just place a bunch of diodes in series after the output ... ex 1n400x diodes will have around 0.8v-1v drop per diode... but individual diodes would be harder to keep cool compared to a plain metal sheet or a heatsink on which you can screw a to220 regulator.