Your statement that "when heat turns cold, light goes out" is not entirely accurate. Light does not require heat to exist or propagate. Light is a form of electromagnetic radiation that can travel through space, regardless of the presence or absence of heat.
Heat is associated with the movement of particles and the transfer of thermal energy. When objects or substances are heated, the atoms and molecules within them gain energy and start to vibrate and move more rapidly. As a result, they emit thermal radiation, which can include infrared light (a form of light that we cannot see with our eyes) among other wavelengths.
However, light itself is not dependent on the presence of heat. Light can be generated in various ways, not just through heating. For example, light can be produced by chemical reactions, electrical energy, or even by certain quantum processes. In each case, the light is created through the excitation and subsequent emission of photons.
Once light is emitted, it can continue to travel through space until it encounters an object that absorbs or scatters it. This is why we can observe light from distant stars and galaxies that are millions or even billions of light-years away. The light emitted by these celestial objects travels through the vastness of space and eventually reaches our telescopes, allowing us to see them.
In summary, light can exist and propagate independently of heat. While heat can be one source of light, it is not the only way light is generated, and light can continue to travel through space even after its source has cooled down or ceased to exist.