Before our solar system existed there was a cloud of gases, the leftover stuff of dead stars.
Debris, bits and pieces of various elements from rocky sources swirled in the gassy cloud. Over time, this large cloud collapsed in on itself and compressed into a rather large spinning disk.
The disk continued to spin, further condensing the middle into a big ball. This innermost part, the bump in the center of this disk of condensed gases grew very hot as the gases inside reacted with each other.
Over time, the heat intensified, causing more and more pressure to build. Like a pressure cooker, the center of the disk blew open when the pressure inside became too great to be contained.
The hot winds from the explosion blew out the debris that formed the planets including the carbon that eventually became life on Earth. The central burning-hot core that remained became the sun. All in all, this process took one hundred million years.
That may sound like a long time, but our solar system, to date, has been around a lot longer than a mere hundred million The sun, Earth, and other eight planets are over 4.5 billion years old.
In the last twenty years, scientists have spotted similar spinning disks of gaseous clouds around new stars, confirming at least the basis of this theory.