The answer to 'how to fix switch' is to first turn off the power to the switch at the circuit breaker. Then, remove the switch cover plate and disconnect the wires from the switch terminals. Test the switch with a multimeter to determine if it needs to be replaced. If so, install a new switch, reconnect the wires, and restore power. Be sure to follow all safety precautions, such as wearing gloves and turning off the power before working on any electrical components.
Fixing a faulty switch is a relatively simple DIY task, but if you're not comfortable working with electricity, it's best to hire a licensed electrician to handle the repair.