A switch prevents or allows current to flow through it. It is a device used for making and breaking connections in an electric circuit. For example, when anyone presses the button (switch) for light/fan, with the completion of the circuit, the device starts to function.