A thermos flask can keep hot drinks hot and cold drinks cold. How does it know?
A thermos bottle is actually two bottles, one inside the other. The space between the two bottles is evacuated and sealed. When hot liquid is in the bottle the heat is prevented from escaping as it cannot be conducted through the vacuum. When a cold liquid is in the bottle the heat outside cannot conduct through the same vacuum to heat the liquid inside. The glass of the bottles is silvered to make them reflective so that any heat that may try to cross the vacuum by radiation will be reflected back the where it came from. Since there is no gas in the vacuum separation there can be no convection of heat across the void either. So radiation, conduction, and convection, which are the three forms of heat transfer are all blocked by the thermos bottle.