Replacing a standard light switch is one of the simplest electrical jobs, but it still demands the cardinal safety rule: cut the power and confirm it's off before touching the wires.
Power off and verify
Turn off the breaker for that switch and confirm the wires are dead with a non-contact voltage tester — the wall switch alone isn't enough. Remove the cover plate and unscrew the switch from the box.
Note the wiring
A standard single-pole switch has two terminals plus a ground. Photograph the connections first. Transfer the two wires to the new switch's brass screws (orientation doesn't matter on a single-pole), and connect the ground to the green screw.
If it looks different
If there are three or four wires plus travelers, it's a three-way or smart switch and wires differently — label the common before disconnecting. Aluminum wiring, scorched wires, or a switch you can't identify are reasons to call an electrician.