Imagine that we would like to create a machine that can simply fly straight upward. Let's not even worry about getting back down for the moment -- up is all that matters. If you are going to provide the upward force with a wing, then the wing has to be in motion in order to create lift. Wings create lift by deflecting air downward and benefiting from the equal and opposite reaction that results (see How Airplanes Work for details -- the article contains a complete explanation of how wings produce lift).
A rotary motion is the easiest way to keep a wing continuously moving. You can mount two or more wings on a central shaft and spin the shaft, much like the blades on a ceiling fan. The rotating wings of a helicopter function just like the airfoils of an airplane wing, but generally helicopter airfoils are symmetrical, not asymmetrical as they are on fixed-wing aircraft. The helicopter's rotating wing assembly is normally called the main rotor. If you give the main rotor wings a slight angle of attack on the shaft and spin the shaft, the wings start to develop lift.
In order to spin the shaft with enough force to lift a human being and the vehicle, you need an engine, typically a gas turbine engine these days. The engine's driveshaft can connect through a transmission to the main rotor shaft. This arrangement works really well until the moment the vehicle leaves the ground. At that moment, there is nothing to keep the engine (and therefore the body of the vehicle) from spinning just as the main rotor does. In the absence of anything to stop it, the body of the helicopter will spin in an opposite direction to the main rotor. To keep the body from spinning, you need to apply a force to it.
Enter the tail rotor. The tail rotor produces thrust like an airplane's propeller does. By producing thrust in a sideways direction, this critical part counteracts the engine's desire to spin the body. Normally, the tail rotor is driven by a long driveshaft that runs from the main rotor's transmission back through the tail boom to a small transmission at the tail rotor.
In order to actually control the machine and, say, guide it into a canyon to complete the ultimate rescue, both the main rotor and the tail rotor need to be adjustable. The next three sections explain how pilots guide the helicopter into taking off, hovering or buzzing off in a particular direction.