Attempting to adapt a 4.5v flashlight for 120v AC use
The absolutely universal way you power a low-voltage DC project from mains voltage is to use common-as-dirt "wall wart" type power adapter. 

Anything that touches mains power must meet strict design restrictions and slowly grind its way through the process of being tested at a UL testing lab and listed (or competitor: CSA, TUV etc. CE is not a testing lab.)  But these rules only apply to the wall-wart itself.  The fun product downstream gets to be entirely low-voltage DC, which means the low-voltage rules apply to it instead of the mains-voltage rules.  The result is vastly improved safety, simpler design requirements and quicker testing. 

And that is why you should use wall warts too. 

Similarly, if you are doing household wiring inside a wall, mains wiring must comply with the tough Class I rules, whereas low voltage wiring can use simpler rules.  "Put the wall-wart in the basement and run intercom wire to the load" is a strategy that's been in use since "Princess phones" had lighted dials.