Reference:

How Was the Sun Formed?

In a wide expanse of space, gravity drew dust and gas together to create the young solar system. The sun formed first from the vast material, with the planets close behind. But how did a sea of swirling particles become the brightest star in our sky?

The Sun: Our Perfectly Average Middle Aged Star
The Sun: Our Perfectly Average Middle Aged Star
Credit: Space.com

Although it may look empty, space is filled with gas and dust. Most of the material was hydrogen and helium, but some of it was made up of leftover remnants from the violent deaths of stars. Waves of energy traveling through space pressed clouds of such particles closer together, and gravity causes them to collapse in on themselves. As the material drew together, gravity caused it to spin. The spin caused the cloud to flatten into a disk like a pancake. In the center, the material clumped together to form a protostar that would eventually become the sun.

The young protostar was a ball of hydrogen and helium not yet powered by fusion. Over the course of about fifty million years, the temperature and pressure of the material inside increased, jumpstarting the fusion of hydrogen that drives the sun today.

The formation of the sun didn't take up all of the cloud it was born from. What was left continued to orbit the star, while planets formed from the leftover material. The sun is an average-size star, not too big and not to small. Its size makes it an excellent star to orbit, as it is neither large and fast-burning nor small and dim.

Several million years from now, the hydrogen inside of the sun will run out, and the star will swell up into a red giant with a radius extending to Earth's orbit. The helium at its core will also be consumed. The star will never be hot enough to burn the oxygen and carbon that are left behind, so the sun will fizzle out and become a white dwarf.

— Nola Taylor Redd, SPACE.com Contributor

Correction: This article was updated Jan. 18 to correct an error in describing the sun's eventual fate.

Related:

More from Space.com