how is a solar system formed
The outer layers of these planets are made up of hydrogen and other gases. So the Sun is the collapsed core of an interstellar gas cloud, and the planets, asteroids and comets are small lumps of dust or ice chunks which stayed in orbit instead of spiraling into the Sun.