Light switches wear out over time, requiring replacement. To replace a light switch, the wires connected to the device must be removed in a manner that the insulation-stripped wire ends aren't broken off, as the wires in a light switch receptacle may not have much length to work with. If the wire ends are broken off each time the switch is remove over a period of years, there will come a time when there won't be enough wire length left to pull the switch from the wall during future replacements.
Turn off electricity at the circuit breaker by turning the circuit's breaker switch to the "OFF" position.
Remove the screw that secures the switch faceplate to the fixture using a screwdriver of the correct type. Gently pull the faceplate away from the wall and lay it off to the side along with the mounting screw.
Remove the light switch assembly mounting screws which secure the switch assembly firmly to the wall and lay them off to the side along with the previously-removed cover and screw.
Gently pull the entire light switch assembly outward away from the wall so that the wire terminals on both sides of the switch are exposed and able to be easily worked with using a screwdriver. Loosen the terminal screws until the bare wire ends move freely. Make note of how the bare wire end curves around the post of the screw, as it will have bent into a curve when the terminal screw was tightened down at the time of installation.
Remove the wire from the screw post by grabbing the curved portion of the wire with the needle-nosed pliers and pulling it out-and-away from the screw post. If there isn't enough room to get the tip of the pliers around the curved portion, then grab hold of the insulated portion of the wire with the pliers and then use your hand to manipulate the light switch in a way that facilitates the hooked end of the wire to come free of the terminal screw post. Perform this step for all additional wires.
If the switch you are replacing is of the more modern style where the bare wire ends are pushed into holes in the back or sides of the switch rather than wrapped around a screw post, there will be small slots near each hole. Simply insert a small flathead screwdriver into the slot which will activate the release mechanism inside, allowing the wire to be pulled from the hole.