If there is a difference in temperature between two objects, energy is transferred from the hotter object to the cooler one. This will continue until both objects are at the same temperature. When they are at the same temperature, we say that they are in thermal equilibrium, and there is no overall transfer of energy any more between the two objects.
Energy can be transferred from a hot object to a cooler one by:
When a substance is heated, its particles gain internal energy and move more vigorously. The particles bump into nearby particles and make them vibrate more. This passes internal energy through the substance by conduction, from the hot end to the cold end.
This is how the handle of a metal spoon soon gets hot when the spoon is put into a hot drink.
The particles in liquids and gases can move from place to place. Convection happens when particles with a lot of thermal energy in a liquid or gas move, and take the place of particles with less thermal energy. Thermal energy is transferred from hot places to cold places by convection.
All objects transfer energy to their surroundings by infrared radiation. The hotter an object is, the more infrared radiation it gives off.
No particles are involved in radiation, unlike conduction. This means that energy transfer by radiation can work when objects are not touching, even in space: