Our Solar System started to form about 4.6 billion years ago from a cloud of gas and dust. The main gases were hydrogen (74%) and helium (24%). This cloud was part of a bigger cloud called a nebula.
This cloud started to collapse under the influence of gravity, creating a dense core with a disc of material surrounding it.
All stars begin life in the same way.
Gravity begins to pull the dust and gas together.
As the mass falls together it gets hot. A star is formed when it is hot enough for the hydrogen nuclei to fuse together to make helium. The fusion process releases energy, which keeps the core of the star hot.
When a gas is compressed, its volume decreases. The speed of the particles in the gas increases, causing the temperature to rise. This is why the temperature in a star increases to allow nuclear fusion to take place and also why a bicycle pump heats up when it is used to pump a tyre.
During this stable phase in the life of a star, the force of gravity holding the star together is balanced by the expansion due to the fusion energy. The Sun is at this stable phase in its life.
The Sun took ten million years to form.
Although the Sun comprises most of the mass in the disc, there was material left over. As the disc continued to spin, pieces of material bound together because of gravity to form larger objects. Some became large enough to form planets. Smaller objects became asteroids or comets.
Scientists have obtained a lot of information about the formation of the Solar System by studying asteroids and comets.