The temperature of a hot cup of coffee left sitting on the table will fall until it also reaches thermal equilibrium with the air temperature in the room.
When a soda can is taken out of the refrigerator and left on the kitchen table, its temperature will rise – rapidly at first but then more slowly – until the temperature of the soda equals that of the air in the room. At this point, the soda and the air temperature in the room are in thermal equilibrium .
The change in temperature is due to the transfer of energy between object and the environment.
For a closed system in which heat energy cannot enter or leave, the heat lost by objects at a higher temperature is equal to the heat gained by objects at lower temperature until thermal equilibrium is reached (at which point the final temperature of both objects is the same).
The final temperature will be somewhere between the initial low temperature and the initial high temperature.
You can loosen a tight metal jar lid by holding it under a stream of hot water. Both the metal of the lid and the glass of the jar expand as the hot water adds energy to their atoms. With the added energy, the atoms can move a bit farther from each other than usual, against the interatomic forces that hold every solid together. However, because the atoms in the metal move farther apart than those in the glass, the lid expands more than the jar and is loosened.
Expansions slots are often placed in bridges to accommodate roadway expansion on hot days. This prevents buckling of the roadway. Driveways and sidewalks have expansion slots for the same reason.