Project: Tester of light sources , need little advice

That way in the image, you should get a LOW normally, HIGH when the switch is closed.
You may have to rotate the switch 90° if this setup doesn’t work.

There is a sketch in the IDE examples that shows how to detect a change in switch position.
When a transition from LOW to HIGH is detected, you can do what’s needed …