A switch loop occurs when both the switch at the end of a circuit or an incoming cable and a neutral become hot leads and connect to a terminal. In layman’s terms, it’s when a wiring circuit is created to connect a light fixture to a wall switch, so you don’t have to a string or a cable to turn on the light fixture but can instead flip a switch or push a button to activate the light on or off.
How it works: in a switch loop, the hot and neutral wires arrive at the light fixture before reaching the switch. If you simply connected the wires from the light to the switch, the light would always be on. That would not only drive your electric bills way up, but it would burn out bulbs way too quickly. Instead, you use a switch loop wiring pattern to control when you want the light on and off.
To make a switch loop, connect the incoming hot (black) wire to the white neutral wire that runs to the switch. Mark the white wire at each end with black tape or black paint to indicate it is hot. Now the incoming white neutral wire is attached to the light fixture, as usual, and the black wire from the switch is connected to the light fixture. In this way, the hot wire initially bypasses the fixture, then loops through the switch and back to the fixture.