Simple npn transistor to control relay to move higher voltage to circuit with simple gpio input voltage-- think gpio and PC power supply to power a motor.. Or lamp.. For more sensitive input look at my darlington example..
The diode is optional and for safety in reality... You may not need it depending on your application.. Your milage may vary though..
The cap next to the lamp is totally optional and can be cut-- was just for a soft off effect...