Before working on any electric circuit, make sure the power is off and there is no danger of electrocution.
A light that is controlled from two locations is called a 3-way switch. There are a few different ways to wire 3-ways, but the easiest way is where the light is between the two switches.
Normal cable used in lighting circuits is 12-2 non-metallic, sheathed cable. 3-way circuits need 12-3 cable, which has an extra wire in it. This is usually a red cable called a traveler.
At the first switch, there will be the cable that comes into the box from the power source. There will also be the 3-way cable that goes out of the box to the light. Tie the white neutral wires together from the incoming and outgoing cables.
Also tie the bare copper ground wires together from the incoming and outgoing cables.
The 3-way switches are different than single-pole switches even though they look alike. The 3-way switch has 3 terminal screws on the side. The picture shows three types of switches.
Single pole---Controls a light from one location.
3-way---Controls a light from two locations.
4-way--Controls a light from three or more locations.
From the out going cable, attach the red traveler wire to the travel terminal. I have it labeled as terminal # 1. Next, attach the black wire to terminal # 2.
From the incoming power, attach the black cable to terminal # 3. Make sure all wires are tight and secure the switch into the box.
At this point the incoming wire comes from the first switch and the outgoing wire goes to the second switch.
At the light fixture tie all the copper wires together including the ground wire from the light fixture if there is one.
There's a lot of wires and this seems confusing, but it just takes a little concentration.
Attach both of the red traveler wires together.
A white wire will need to be used for a hot wire so it will need to be coded as hot by painting it black or wrapping both ends with black tape. This seems like a code violation, but it is fine and necessary.
Connect incoming black wire with outgoing white wire that's coded hot.
This will leave just one white wire and one black wire. Connect the white and black wires to the corresponding wires on the light.
Now on the last switch, connect the ground wire to the green ground screw on the switch.
Connect red traveler to traveler terminal. I have this labeled as # 1.
Connect white wire which is coded hot to the switch's top terminal. This is terminal # 2.
Finally, connect black wire to bottom terminal screw which is # 3.
Secure all the wires and screw the switch into the box.
Turn the power back on and check the light switch from both locations to make sure each switch works.