Energy passes through solids as particles vibrate more and knock into their neighbours, passing energy along.
In liquids and gases, heated fluid expands, becomes less dense, and rises.
All objects emit infrared radiation, part of the electromagnetic spectrum. It needs no medium, so it works through a vacuum and reaches us from the Sun.
A vacuum flask is designed to reduce all three ways energy is transferred.
The same ideas explain home insulation, heating systems, and the Earth's energy balance.