Since the 1990s in the United States and 2000 in Europe, passenger aircraft cannot operate if they do not have a traffic collision avoidance system (TCAS). A TCAS is a radio system that works by transmitting a signal that tells the plane's altitude direction and airspeed. If an aircraft picks up an indication of another aircraft, it works out how far the two are from one another. The TCAS also uses an antenna to tell which direction the signal is coming from and then calculates whether it constitutes an unsafe situation.
The TCAS only tells a pilot to climb or descend
Should the chance of the two aircraft coming close to each other happen, a voice recorder in the cockpit will say in a concerned voice, "traffic! traffic!" to alert the pilot. The other aircraft will also be displayed in yellow on the flight monitor. This is a signal for the pilot to look out of the windows for visual signs of another plane. If the aircraft continue to get close to each other, the TCAS issues an advisory regarding direction and altitude.
Pilots are trained to follow the TCAS instructions even if it contradicts those given by air traffic control. This is because the TCAS system is far quicker at reacting to the situation and making decisions. The TCAS system never tells a pilot which way to turn but climb or descend. If, however, a pilot has a visual contact of the other plane, the rule is to turn to the right.