Switch supply for external circuit
If you want a high-side switch, then a P-channel MOSFET is needed; you have drawn an N-channel.
To turn a P-channel on, you pull its gate low. To turn it off the gate is taken high, to the supply voltage. MCUs generally have 3.3V or 5V output. A buffer, can be as simple as NPN transistor with collector connected to Gate and a pullup resistor to 12V, can be used.

Just the way Eduardo drew it up.