Turn Off the Breaker
Any time you are doing any electrical work on a circuit beyond simple "replace light bulb", you MUST turn off the breaker. After turning off the breaker, verify that power is off, ideally with a Non-Contact Voltage Tester (NCVT), such as this Klein from Amazon:
Testing is important because sometimes you have either multiple circuits connected to one appliance or light (they should always be handle-tied if that is the case, but sometimes things are not done correctly) or multiple circuits running through a box - e.g., the junction box above a light might have wires for a totally unrelated circuit running through it, so you want to make sure all power is off in any box before you start pulling wires apart.
Reverse Hot/Neutral
In the US, all 120V circuits are supposed to be switched on the hot wire. But sometimes things are done incorrectly and the neutral is switched instead. In that situation, you may find live wires where you don't expect them when the switch is off.
240V Circuit
While most residential lighting is on 120V (hot/neutral, hot switched) circuits, commercial lighting is often on 240V circuits and a lot of lights can be powered by 120V or 240V. If a light is on a 240V circuit and only one hot wire is switched then the other hot wire will still be live when the switch is off. I don't know if code requires both hot wires to be switched, but even if it does, things are not always done properly so turning off the breaker is the safe thing to do.
Lighted Switch
A lighted switch requires power for the light. There are a few ways to do that:
Hot/Neutral - This is the modern way to do things. The catch is that many older homes have switch loops with no neutral in the switch box, so many older lighted switches would assume that neutral is not available.
Hot/Ground - This is marginal. Under certain circumstances, returning a small amount of current through ground to power an indicator light or other things is allowed. But that is very limited and since older homes often do not have ground at switch boxes, many older lighted switches would assume that ground is not available.
Hot/Switched Hot - This used to be extremely common. The lighted switch (or timer or other device that needs a little bit of power for itself) "leaks" a little bit of power through the switched hot wire to complete its own circuit. This is not enough to light up an incandescent or a typical fluorescent light. But it is enough to:
- Cause LEDs to light up (dim, but noticeable) or blink
- Present dangerous power at wires in the light fixture