The screw on my light switch somehow came loose on its own, and when I screwed it back in it made the light flicker and go out. Would it be safe to unscrew it again? What would make this happen?
Check to see if you tripped the breaker. If it isn't tripped, shutoff the breaker. Now you can unscrew the screws and check the switch. The flicker and out can be caused by the wiring going into the back of the switch (backstabs) instead of hooking the wires around the terminal screws. Check for tight connections and screw the switch back into the box. Turn the power back on and test the operation.... make sure you test the bulb too... good luck.
It sounds like the screw hit the wiring it could be backstabs or wire nuts or even the screw shorting the wiring. There should be a breaker someplace that removes power from that circuit you need to find the correct one. Since it did not trip the breaker I would be looking for a loose connection (usually a backstab or push in connection) backstabs in the U.S. are 14 awg wire so the breaker would be a 15 amp. If that was the case but it could be a loose connection. Pulling the switch out is the only way to know for sure but it is most likely a loose connection that needs to be repaired before the wires burn off from arcing.