The answer to 'when to replace switch' is that switches should typically be replaced every 10-15 years, or sooner if they show signs of wear or damage. Switches can wear out over time due to regular use, and older switches may also become less reliable or pose safety risks as the components degrade. Signs that a switch needs to be replaced include flickering lights, buzzing or humming noises, or the switch feeling loose or wobbly when operated.
Replacing a switch is generally a straightforward DIY project, but it's important to take proper safety precautions and turn off power to the circuit before working on it. If you're unsure about the process or have any concerns, it's best to consult a licensed electrician to ensure the work is done safely and up to code.