When two substances at different temperatures are in contact, they exchange a certain amount of energy. One's temperature increases, and the other's decreaeses. In the end, they both reach the same temperature, which is known as equilibrium temperature.