Lights that a person can control from two different light switches use specialty electric switches called three-way switches. Wiring this type of switch requires a special kit that features an additional red insulated wire to go along with the white and black wires already inside the sheath.
Normal electrical terminals feature two terminals. When they are connected, power runs through them, and the light is on. When they are disconnected, power stops, and the light is off. In the case of a three-terminal or three-way switch, the switch either connects the first terminal with the second or the third.
A typical alignment involves normal wiring running from the fuse panel to the first three-way switch. The hot wire, usually black, comes into the switch on the left. Three-way wire, which is white, black and red, runs from the left-hand switch to the right-hand switch. The white wire has the ground, and the black and red wires bring output from left switch terminals. If the switch is up and terminals one and three have a connection, then the connection switches to terminals two and three if the switch is down. If the light is on at this point and someone flips either switch, the light turns off.