Product guide
Materials:
- 5V MOSFET
- 12V Magnet
- 12V Fan
- Wires

Connect the input power to the terminals shown on the image.
Connect the magnet and aux fan to the output terminals. Polarity for the aux fan is shown in the picture. The electromagnet doesn't have polarity.

Connect the MOSFET to your desired microcontroller as depicted. Use any digital or analog pin for signal.