How can heat travel through space if it is a vacuum?
Heat in the form of infrared waves (Radiation) can travel in vacuum.
Infrared waves are a form of electro-magnetic radiation and can travel in vacuum at the speed of light.
These infrared waves are resultant from the Sun. When these light come to the Earth's atmosphere, they create heat. These heat is created by the excitation of atoms that are present in the Earth's atmosphere.
So, the heat that we feel on Earth is due to the light or electromagnetic waves from the sun.