Our solar system started out from nothing more than a great big motionless cloud of dust and gases. At some point there was a large disturbance; something comparable to a galactic earthquake and, that disturbance caused particles to begin sticking to each other eventual enough concentrated gravity occurred for the dust cloud to form into a nebula. After some time the centre of this nebula had a proto star enough mass to collapsed on itself and become a main sequence star.
That star is our sun today. The remaining dust and gasses started orbiting around this new star over time the materials separated heavy particles like rock orbited near the sun, gases orbited second closest and, things like ice orbited the furthest away. The sun sort-of had rings of material organised by density. Eventually the materials in each ring began to fuse together into planets and moons. another theory suggests that this whole process happened in reverse. it states that first of all the planets formed from the collection of dust, theres bodies of mass pulled them-self’s together creating a large mass in the center of our solar system. eventually this mass collapsed on it’self to perform nuclear fusion and, our sun was born