Imagine we boiled some water so that all of the water particles turned into water vapour (steam) and then we put that steam into a very, very cold room (let's say the temperature of the room was -20oC - chilly!). Over time, we know that the temperature of the gas would start to cool down as heat energy was lost to the room.
Below, is a picture of how the temperature of the steam (to start) would change as the time goes on.