The circuit is called a high sided switch.
The simplest has two transistors the first is an NPN which generates a 0 to 12V signal from a 0 to 5V one. The second stage puts that to a PNP transistor high side switch. You can also do the same thing with FETs