There are basically two approaches here which are good:
Use a N-channel MOSFET on the "low side" of the load, so the drain connects to the load and the source connects to ground.
Depending on the MOSFET threshold voltage you may be OK with direct drive of the MOSFET gate from your microcontroller, and this usually works OK in systems that don't need to be very fast or very high power. Choosing a logic-level FET (so you're confident about turning it on) is a good approach.
(In some cases like high-power, high-speed systems it's best to drive the MOSFET gate hard on, using a gate driver such as a Microchip MCP1402 IC with a 12V supply.)
It's also a good idea to put a fairly high value resistor from the gate to ground, bleeding the stored charge off the gate in case the controller circuit goes into a high-Z state, in which case the load will not turn off. A small series resistor (say 10 ohms) may also be used to dampen ringing formed by the FET's gate capacitance and parasitic inductance of the gate wiring.
OR, you can go for a high-side switch. If there's another common ground path, or you're not sure about how ground is connected, and you don't want to break the circuit there, sometimes cutting off the +12V rail is a better approach.
So we need a P-channel MOSFET.
Connect the source to +12V, and connect the drain to the load (positive side of the load, unlike the low-side-switch case where the MOSFET is connected between the load negative and ground and the +12V rail is always connected to the load. In this high-side-switch case we're going to leave the ground connected to the load and insert the MOSFET between the +12V rail and the load positive.)
We'll need to put a pull-up resistor between the gate and the source, say 10k, which will keep the gate at +12V. The P-channel MOSFET will remain turned off by default.
Now, when the gate is sufficiently negative relative to the source, like when VG is say below 10V or so relative to ground, VGS will be -2V or so, and the FET will turn on.
You can't just connect a microcontroller which has, say, 0-3.3V logic levels to this - the FET will never turn off. (And it may not like being pulled up to +12V on that pin.)
We need another transistor. A small N-channel MOSFET or NPN BJT. It doesn't have to be a high-power device. A 2N3904 would be perfectly fine, for example.
Connect this with the collector to the gate of the power MOSFET, connect the emitter to ground, and the base to your microcontroller circuit with a resistor.
Now, when the MCU pin goes to +3.3V, the small NPN transistor turns on and pulls the high-side power MOSFET gate down close to ground, turning it on and turning the load on.
OR... investigate the enable/PWM input signal that is provided on modern four-wire brushless PC fans.