All that is needed is a diode which only allows current to flow in one direction. If you are working off the mains, a transformer is needed for isolation and to reduce the voltage to what you need. The diode will produce pulsating DC but if you want smooth DC, a filter cap is needed. The size of the cap can be estimated from this equation:
C = (load current)*(time between pulses)/(voltage ripple)