You can try to find a "high-side driver" schematic. If you need to control more than 5V, It will have at-least one more transistor (probably a regular bipolar transistor rather than a MODFET).
The problem is... To turn-off the MOSFET the gate-source voltage needs to be (about) 0V. If you have a 12V power supply and you use a P-Channel MOSFET, you'll need 12V on the gate to turn it off, so you can't control it directly with 5V (or 3.3V) logic.
You can find Solid State Relays that can do it. Just make sure to get a DC SSR. AC & DC SSRs are not (usually) interchangeable.