Sometimes you need to be able to turn devices on and off from your Arduino. If the current being drawn is low enough (under 40 Ma MAX, 20Ma recommended) then you can just use the IO pins of the controller to turn the device on and off. The Blink example program does exactly this with an LED.
Often you will have the need to switch on/off a device that draws more current than the Arduino pins can handle directly without damage, or switch a device that requires a different voltage than the Arduino has available on a pin. In these cases, a transistor can be used as a switch that is controlled by the Arduino pin’s state (High/Low) to switch the device on/off
Most any transistor can be used as a switch, but the simplest circuit I have found uses the 2N7000 N-Channel MOSFET. In fact you only need the 2N7000, no other parts are required.
This article explains how to make such a simple switch circuit using a 2N7000 MOSFET transistor. This example demonstrates with a buzzer running at 6Volts as the load. Substitute your own load device and voltages as long as they are within the limits of the 2N7000 transistor. (200Ma and 20V)
I have adapted the schematic from the linked article to be more generic and for the Arduino, along with the pin out of the 2N7000.
2N7000 Transistors are cheap and can be easily obtained from EBay, Amazon etc. Buy in bulk because these are very handy devices to have on hand.