There are a number of ways this switch might be wired. It depends on where in the circuit the switch is located. Always connect the wires to the new switch exactly as they were connected to the old switch. The black wire is always the hot wire. If a red wire is used, it is also hot. The white wire is sometimes neutral, but on some circuits it becomes a hot line.
If this is the case, the electrician will paint the end black or wrap a layer of tape around it.
1. Before replacing any switch, turn off the power to the circuit.
2. Remove the switch cover, unscrew the switch from the box, and carefully pull the switch out of the box. At this point, be very careful. If the wrong circuit at the service panel is shut off, the wires will still be hot.
4. Check for a current with a voltage tester by touching one probe to each terminal on the switch and the other probe to a grounded metal box or the ground wire.
5. If the switch has rear push in terminals, insert the probe in each of the release slots. If the tester glows at any connection, the wires are hot. Recheck the service panel and get the correct circuit.