Stars are huge spheres of hot glowing gas that produce light and energy through nuclear fusion. They are born in cold clouds of gas and dust called nebulas, which collapse under gravity and heat up. There are many types of stars including red dwarfs, yellow stars like our Sun, giant stars, and massive blue giants. Nearly all stars belong to galaxies which range in shape and can contain billions of stars. Most stars end their lives by expanding into red giants and shedding their outer layers, leaving behind dense white dwarfs or black holes if they are especially massive.