The sun and all the other planets began as a giasnt cloud of dust and molecular gas
4th step
Something happened 4.57 billion years ago that caused the cloud to collapse. This could have been caused by a passing star or supernova shock waves, but the end outcome was a gravitational collapse at the cloud's center.
5th step
This explosion caused the dust and gas to move around and gather dense region as it started rotating and the heat started to spike up. The majority of the material congealed into a ball in the middle, while the rest flattened out into a disk that surrounded it. The rest of the material would form the protoplanetary disc while the ball at the center produced the Sun.
Last step
Only metals and silicates could exist in solid form closer to the Sun due to their higher boiling points, and these would eventually form the terrestrial planets of Mercury, Venus, Earth, and Mars.
The giant planets (Jupiter, Saturn, Uranus, and Neptune) developed beyond the threshold where material is chilly enough for volatile icy compounds to remain solid between Mars and Jupiter's orbits. Leftover debris that never became planets congregated in regions such as the Asteroid Belt, Kuiper Belt, and Oort Cloud.
Within 50 million years, The temperature, reaction rate, pressure, and density were all increased until hydrostatic equilibrium was reached. At this point, the Sun became a main-sequence star. The heliosphere was formed by solar wind from the Sun, which swept away the remaining gas and dust from the protoplanetary disc into interstellar space, effectively ending the planetary formation process.