To understand how a helicopter works (and in fact the mechanics of other aircraft too), it's helpful for you to be familiar with a key concept in physics, called Newton's Third Law of Motion. It says, in general terms, "for every action, there is an equal and opposite reaction".
Here's a simple thought experiment. Picture yourself wearing a pair of rollerskates, standing up, holding a basketball. Now, throw the basketball out in front of you using a two-hand pass (bring it to your chest and push it out in front of you). You'll find yourself moving backwards on the skates. You won't be moving as fast backwards as the ball will be moving forwards, because you have more mass than the ball, but you'll move, because the force of you pushing the ball out forward created an equal force moving you in the opposite direction.
A helicopter, and in fact most powered aircraft, work the same way. when a helicopter's rotor moves through the air, it pushes air downwards through a combination of its airfoil design, which moves air downwards as it passes over the top of the rotor, and an upward angle to the blade relative to the oncoming air that pushes the air with the underside of the rotor. By Newton's Third Law, the force pushing the air downward creates an equal and opposing force pulling the rotor, and the helicopter attached to it, up into the air.
To hover, all that's required is for this force pulling the helicopter up (you can consider it as either "lift" or "thrust") to equal the force of gravity on the helicopter, which is its weight. If these forces balance, the helicopter will remain the same distance off the ground. If lift is greater then weight, it will rise into the air, while if weight it greater, it will sink or fall.
Now, normal aircraft have to move forward through the air in order for their wing to get the airflow needed to generate lift. A helicopter, by rotating its wing, can produce the airflow over the lift surface without the entire helicopter having to move forward (or backward or sideways for that matter). So, it can rise straight up into the air and truly hover over a single spot on the ground.
The tail rotor of a helicopter is necessary to counter another force produced by the helicopter; torque. Torque is similar to force - really it is a force - but it's being produced in a circular direction instead of a straight line. The helicopter's engine uses torque to spin its rotor. Again, by Newton's Third Law, if the rotor of the helicopter is being spun clockwise by the engine, the helicopter itself will begin to spin counter-clockwise.
To counteract this torque, most helicopters have a second, smaller rotor which works the same way as the big one, but directs the force of its thrust sideways in the opposite direction to the way the helicopter's body wants to spin.
This sideways rotor doesn't necessarily have to be on the tail, but it works best if it's on the end of a long lever arm, such as the tail boom of the helicopter. The closer it is to the main rotor's shaft, the more thrust it has to produce in order to counteract the torque of the main rotor.
It doesn't have to be on the side of the tail either; many modern helicopter designs have the tail rotor spinning inside an aerodynamic duct in the middle of the tail:
Helicopters also don't necessarily have to have a tail rotor at all; all that's required is equal, opposing torque to that of the main rotor. A common substitute for a tail rotor is a second, counter-rotating main rotor: