Here's a breakdown of the process:
* The Solar Nebula: This cloud was primarily composed of hydrogen and helium, but it also contained smaller amounts of heavier elements like carbon, oxygen, and iron.
* Gravitational Collapse: Over time, the nebula started to collapse under its own gravity. This caused the cloud to spin faster and flatten into a disk shape.
* Sun Formation: At the center of the disk, the dense material accumulated, forming the Sun. The Sun's immense gravity and pressure triggered nuclear fusion, releasing enormous amounts of energy and marking the birth of our star.
* Planetary Formation: The remaining material in the disk began to clump together, forming smaller bodies called planetesimals. These planetesimals collided and merged, eventually growing into the planets we see today.
So, while Earth and the Sun are very different objects, they share a common origin: the solar nebula.