Safety Rules Before Any Work on Electrical Wiring
Swapping a light switch or a socket looks like a small job, but it is work on an electrical circuit, and a mistake there cannot be undone. These are the rules electricians keep before they touch a single wire.
Switch off at the panel, not at the switch. A switch breaks only one side, and the other may still be live. Find the breaker for the circuit, switch it off, and tape a note or a lock on it so nobody turns it back on while you work.
Then check for yourself. Use a voltage tester on the wire itself before you touch it, and try the tester first on a socket you know is live, so you know the tester works.
Use tools with insulated handles, stand on a dry floor, and take off rings and metal watches. And do not work on the main panel or on any new wiring yourself: that is work for a licensed electrician, and if in doubt, call one before you start, not after.
