For a star to form, it first racks up a bunch of dust & gas in space, then gravity squeezes it until it becomes super, super hot (10 million degrees Celsius). It takes a million years for a star to go from birth to one that shines like our sun.