The answer to 'how to test switch' is to use a voltage tester or multimeter to check if the switch is working properly. First, turn off the power to the switch at the circuit breaker. Then, remove the switch cover and use the voltage tester to check for power at the switch terminals. If there is power, toggle the switch and check again to ensure the power is turning on and off as expected. You can also use the multimeter to test the continuity of the switch by checking for resistance between the terminals when the switch is in the on and off positions.
Testing a switch is a simple DIY task, but if you are unsure of how to properly use a voltage tester or multimeter, or if the switch is not functioning as expected, it's best to call a licensed electrician to diagnose and repair the issue.