Electricity can kill, so it is very important to be careful while working with it and to use safety equipment. If you are not competent working around electricity have an electrician do the work.
Do It Yourself - Home Page
A standard wall switch – technically, a single-pole switch – is a snap to
replace. There are just two screw terminals to worry about. (Some types may
have a third screw. It's for a ground wire.) The most challenging part of this
project is making sure you orient the new switch so you can see the word ON
with the little lever pointing up.
5 Steps
1. Remove the mounting screws holding the switch to the electrical box.
Holding the mounting straps, carefully pull the switch from the box. Be careful
not to touch any bare wires or screw terminals until you've tested the switch
for power.
2. Test for power by touching one probe of the circuit tester to the
grounded metal box or to the bare grounding wire and touching the other probe
to each screw terminal in turn. If the tester glows, there's still
power entering the box. Turn off the correct circuit at the service panel
before proceeding.
3. Double-check the wire connections. The black wire should be
on one brass terminal, and the white wire, marked with a band of black
electrical tape to indicate that it's hot, should be on the other. Disconnect
the wires from the terminals, and remove the switch. If the wires are broken or
nicked, clip off the damaged portion using a combination tool. Strip the wires
so there's about 3/4 inch of bare wire at each end.
4. Wire the Light. Open the light's junction box. Usually,
there's a plate that pops off. Run cable into the box and clamp it. Strip
insulation and make wire splices-black to black, white to white, and ground to
ground. Fold the wires into the box and replace the cover.
5. Remount the switch, carefully tucking the wires inside the box.
Be careful not to break through the protective insulation on the wires when
pushing them into the box. Reattach the switch cover plate, and restore power
to the switch at the main service panel.