From a hot object to a cold object. Ill give an example as to why:
Say you place an ice cube in a glass of warm water, we know that in colder substances, the average kinetic energy per particle (which is the classical definition for temperature is lower). In hotter substances the average kinetic energy per particle is larger, as it is hotter. So now the ice is placed in the warm water. The fast moving particles within the water, that have higher kinetic energies will bounce off the slower moving particles in the ice with lower average kinetic energies. This causes an exchange in energy as the substance with more average kinetic energy per particle (which is temperature) will transfer energy to the slower moving particles located in the ice. This will eventually cause the water and ice to reach an equilibrium temperature as a result of the exchange, with the energy taken to melt the ice included.