Before wiring a light switch please consider the following:
Make sure the circuit power has been turned off, and mark the circuit breaker or fuse to indicate that work is being done.
Make sure the switch is correct for your application. The switch should be rated for the circuit voltage and the amperage. For example: A standard light switch in the USA for a bedroom is typically rated for 120 volts, 15 amps.
Before replacing a light switch, make sure to identify the existing wiring before removing the wires. Make a note describing how the wires are connected to the switch. Create a drawing and mark the wires with electrical tape or masking tape. If possible, take a picture of the wiring inside the switch box, and how the wires are attached to the switch.