Here's how to do it with bipolar transistors -- only really needed if currents higher than 20 to 30 mA needed to be switched -- which is not really the case, here, but it shows the technique:
And, here it is using MOSFETs [almost always the better choice]. There are other MOSFET driving considerations, but for simple, low frequency switching, this will do the job in most cases:

