A two way switch is used in a number of situations. The most common being light switches at either end of a hallway or at the top and bottom of stairs. The idea being that you can turn the light on or off using either switch.
Be aware that mains electricity is dangerous and can kill you. Do not attempt to do any electrical work yourself if you are not competent.
The switches are wired up as in the below diagram. Note that both switches in the diagram are in the up position and there is no path for the electricity to get to the light. As such, the light is off.
Diagram 1 - Light is OFF
If you toggle switch SW1 to the down position you can see that there is now a path for the electricity to get to the light. The light is now on.
Diagram 2 - Light is ON
If you now toggle switch SW2 to the down position as well we once again face the situation where there is no path for the electricity to get to the light. The light is off again.
Diagram 3 - Light is OFF
If you toggle switch SW1 back up again there is once again a path for the electricity to get to the light. The light is now on.
Diagram 4 - Light is ON