Switch is used to open or close the electrical circuit.
Open the switch = NO current is flowing through the circuit.
Close the switch = Current can flow through the circuit.
The switch should be connected to the LIVE wire and not the neutral or earthing wire. If you connect the switch to the neutral wire, even if the switch is opened, the appliance will still be connected to the live wire. This increases the possibility of an electric shock.
The switch should be connected BEFORE the appliance. (There’s no way for you to connect after the appliance.)