If you’re not comfortable working with electrical wiring, voltage testers, and the like, try a few simple procedures detailed in the articles listed below, but, if those don’t solve the problem, call an electrician.
The most common problems with switches are that they cease to work or, worse, give off sparks when you flip them off and on. If the switch gives off sparks, it should be replaced.
If a switch doesn’t work at all, first make sure the problem is with the switch and not the light or device it’s intended to turn on and off. This is easy to do. Just replace the bulb with a working lightbulb or plug a working appliance or lamp into the switch-controlled receptacle and try the switch again.