Turn power off to the line at the circuit breaker or fuse. Use a voltmeter at the starting position where you will connect to existing wiring to ensure that power is indeed off.
Run the wires that will connect from the switch to the light. Ensure at least six inches of wire are coming into the switch.
Strip a half-inch of insulation from the wires entering the box.
Turn the switch so "on" is positioned up. The source black wire is designated as the hot wire and connects to the bottom terminal. Many switches have two options for wiring. The first is found on all switches --- the screw. Wrap the half-inch of exposed wire around the screw and tighten. Tug to make sure the wire is secure before proceeding. In some switches, a small hole is located in the back, not a screw. If you have this type of switch, simply push the wire into the hole and pull to ensure it will not come out. Connect the black wire at the light the same way.
Connect the white wire from the source, using a wire nut, to the white wire that runs to the light.
Connect the ground to the switch box, if the box is metal. The wire will be bare or sometimes contain green insulation. Connect the ground to the box by means of a green ground located in the box or a screw that goes right into the back of the box. Attach the ground wire running to the light to the ground wire running from the switch. Secure using a wire nut. If you do not have enough wire to connect the ground this way, you can "pigtail" the ground wires. Simply take a six-inch piece of unused wire with no insulation. Wrap that wire around the grounding screw and tighten the screw. Pull the ends of all three ground wires together and connect them using a wire nut.
Secure the switch to the box using two screws and attach a switch cover to the box to prevent anyone from touching the wires.