A lot of people are afraid of replacing a broken light switch due to a possible electric shock but when precautions are being taken, it’s quite easy.
The first step involves turning off the power from the circuit breaker feeder. Next unscrew the broken switch from the wall and the screws attached to the switch respectively. You have to mark the wires according to the order they will be fixed and this is live/positive, negative as well as neutral/earth respectively. Finally, you can start fixing the new switch. Note that most switches have the respective endpoints marked in terms of where the positive, negative and neutral will go.