If you want to switch 12V with 5V, then you can use a PNP/NPN pair of transistors. A circuit I have used before:

simulate this circuit – Schematic created using CircuitLab
When you apply 5V to the base of Q2, Q1 will allow the 12V to pass. I left the part numbers as the generic ones in the schematic editor so you will have to make sure you get ones that can handle the current requirements etc.
There are plenty of PNP/NPN switching circuits online you can google if you want a more in depth look or if you want to do something a bit more sophisticated, but this should give you a starting point.
Pretty sure there is a name for this configuration but I can't remember it! If anyone does, feel free to add it in!