The
formation of the Solar System began 4.6 billion years ago with the
gravitational collapse of a small part of a giant molecular cloud. Most
of the collapsing mass collected in the center, forming the Sun, while
the rest flattened into a proto-planetary disk out of which the planets,
moons, asteroids, and other small Solar System bodies formed.
Hope it helped