When replacing a three-way light switch (one that allows you to control one or more fixtures from two different places, such as from opposite ends of a hallway), be sure to return the wires to the proper screw terminals.
On three-way switches, two terminals are the same color and the third terminal— called the common terminal—is a different metal or color. Put a piece of tape on the wire that goes to the common terminal screw. The other two wires can attach to either of the identical terminals.
For more about wiring a three-way switch, see the article How to Wire a Three-Way Switch.