Replacing a light switch is a very easy do it yourself project, whether you need to replace a dead switch or you want to upgrade a switch to add a dimmer or other features. As with any project involving your household electrical system, please use caution, and if you identify signs of a more serious electrical problem, stop and call an electrician.
The first step is turning off power to the switch at the junction box, which should have labels on individual breakers indicating which area of the house they supply. Turn off the power for the appropriate switch and alert other members of the household to the fact that you’re working on the electrical system so they know not to turn it back on. You might want to consider attaching a note to the junction box while you’re working. Don't believe me? Maybe this will convince you: The Orlando Sentinel reported that there was an explosion at an Orlando car dealership when an Orlando electrician mistakenly opened a power box without knowing that a live wire had energized it.
Return to the site of the switch and carefully remove the faceplate, setting it and the screws aside. Use an electrical tester to confirm the switch is not energized. These useful tools are inexpensive and available at most hardware and home supply stores. If the switch is still energized, return to the junction box and try different breakers until you find the right one. (Remember to update the labels when you’re done!)
With the power to the switch off, you can remove the screws that hold it into the wall and gently pull it out. Do this carefully to avoid breaking or stressing the wires. Unscrew the wires from the terminals on the old switch, starting with the neutral wire. If the hot and neutral wires are not clearly labeled, wrap them in electrical tape so they are. Hot wires should be black, while the single neutral or ground wire should be white or green.