Turn the main breaker off to disconnect the electricity to the remainder of the service panel box. Locate the main breaker at the top of the service panel; it is at least 100 amps. Check your home to make sure no electricity is still on.
Remove the screws holding the cover to the service panel. Remove the cover, exposing all the breakers and the wiring for your home. Use a two-wire tester to check for the presence of electricity.
Set the tester dial on 250 AC and touch one lead to a terminal holding a wire at the back of any breaker and the other lead to metal. The needle should not move if the electricity is disconnected correctly. Randomly test other breakers to verify disconnection of the electricity.
Pull a length of 12/2 nonmetallic electrical cable from your light switch location to the service panel. Use a cable ripper to strip 8 to 10 inches of the exterior insulating sheath from the 12/2 NM electrical cable at both the service panel and the light switch location to expose the black, white and bare copper wires inside.
Strip the ends of the exposed wires to remove at least 5/8 inch of insulation, using wire strippers. Do this at both the service panel location and the light switch location.
Connect the white wire from your light fixture to the white wire from the 12/2 NM you pulled to the light switch location. Twist a wire connector clockwise onto the two white wires to hold them together. Twist another wire connector onto the bare copper wire from the light and the bare ground wire from the NM electrical cable.
Bend the ends of the two black wires inside the switch box, using needle-nose pliers to create small hooks. Place the black wire leading from the light fixture under the top brass terminal on the single pole light switch. Place the black wire you pulled from the service panel under the bottom brass terminal. Tighten the terminals by turning them clockwise with a screwdriver.
Install a 20-amp single-pole breaker in your service panel. Use a breaker made by the manufacturer of your service panel. Breakers are not entirely universal. You could void the panel’s warranty by installing a breaker not designed for your panel. The back of the breaker hooks under a slot along the edge of the panel that holds the backs of the other breakers into the panel. The front of the breaker pushes onto the metal bus bar in the center of the panel.
Push the black wire from the 12/2 NM cable underneath the terminal screw at the back of the breaker. Tighten the terminal screw down onto the wire.
Install the white wire underneath a terminal screw on the neutral bar. The neutral bar is thin and silver, with all the white wires from the other circuits connected to it. Install the bare copper wire in the ground bar where all other green and bare copper wires are connected.
Install the cover back onto the service panel. Turn your main breaker on and turn your new breaker on to provide power to your light switch.