If the light goes on the switch is probably faulty.
How to check if wall light switch is broken.
Test the ground wires in the wall switch with a two lead circuit tester which has a red and a black lead running into black body with a small light.
Turn the power off to the switch put tape on the breaker so no one will turn it on.
Keep the circuit breaker flipped off for this.
How to tell if an electric light switch is bad.
Twist them together with pliers and screw on a wire connector.
How to troubleshoot light switches and replace it can be easy and d i y project.
Turn off the power to the light circuit at the breaker panel.
Check for loose or corroded wires.
Take the switch plate off and remove the switch from the box.
This problem can be felt by touch as the plastic piece is usually loose in the switch without any spring tension.
Turn on the breaker.
Disconnect and remove the switch.
Replace it with a new one.
If the specific breaker is not identified turn off the main power switch.
One mechanical failure easy enough to recognize is an internally broken toggle where the lever inside is unable or only occasionally able to activate the contactors.
Clean them up or tighten them as needed.
Shut off the power to the light switch circuit by switching off the appropriate breaker in your home s service panel breaker.
Shut off the power.