Once a star is formed, it gives off both visible and infrared light. But the visible light from a very young star cannot get out of the cloud until the cavity created by the star grows large enough to poke a hole through the cloud. Then, like a chick breaking out of an egg, the star’s light pours into the galaxy.