In this article we will cover the formation of the Earth and the Solar System. As you may have noticed, the Earth is not made of hydrogen and helium gas. There are many many other materials available to us on Earth but most of these did not exist when the universe was born. The Big Bang left us only hydrogen and helium, which were converted into all the other elements we know and love in the cores of massive stars. The lighter stuff was created during the normal life of the star and the heavier stuff was quickly created when these stars collapsed and underwent supernova explosions.
After a star goes supernova, we are left with a massive cloud of dust and gas much like the cloud that formed the star in the first place. However this time there is more than just hydrogen and helium in that cloud. It now contains all the other elements that can be found on Earth including iron, carbon, oxygen etc. Despite stars creating all of this material, the vast majority of matter in the universe is still hydrogen and helium even today. The cloud that would eventually become our solar system was mostly hydrogen and helium along with small amounts of all the other elements generously donated by nearby supernovae. It is also thought that the shockwave from a nearby supernova likely triggered the collapse of this cloud into the solar system (these supernovae seem to come in pretty handy).
It is estimated that this collapse began about 4.6 billion years ago. The process would have been very similar to when the first generation of stars formed in the early universe. Gravity pulls small pieces of dust together forming larger clumps, which then grow larger as they pull in more and more dust. Much like water draining out of a bathtub, the surrounding material develops a spin as it all rushes towards the centre. The early Solar System would have had many large clumps of material all pulling in dust and gas from around them, however the clump that would later become the Sun was by far the largest. The Sun contains 99.86% of all the material in the Solar System, clearly the king of the clumps. However there were still a few other clumps that managed to grow to a respectable size and we're all sitting on one of them right now.
Although our Solar System has only one star containing most of the material, this is not the only way for things to play out. In some cases, two or more stars will form together. There are numerous examples of star systems like this in our stellar neighborhood and it is thought that multiple star systems may actually be more common than single stars like our Sun.
Since we have already seen how material comes together to form a star, we won't worry too much about the clump of material that would go on to form the Sun. Instead we will focus on the other 0.14% of the material that didn't find itself inside of the Sun. This is the stuff that forms the planets, asteroids, and comets.
There are multiple stages in the life of a clump of material. They start out small and irregular, much like any typical rock you would find here on Earth. Some grow large enough that gravity will force them into a spherical shape. Any sections of material that stick out will experience a stronger gravitational attraction and will be pulled harder towards the main body. Similarly, sections with less material will be less strongly bound to the main body. What happens next depends on how resistant the object is to being reshapen. Any protruding sections on very large bodies will sink down under the immense force of gravity. But all this material has to go somewhere and it will make space for itself by pushing up any depressions in the surface. This will continue until the entire surface is roughly the same distance from the centre: a sphere.
Gravity Will Reshape Large Objects Into Spheres
Drops of water are round for a similar reason, only it is surface tension that pulls water into spherical shape. Water flows easily so it doesn't take much force to redistribute it. Solid rock however doesn't bend so easily so a rocky object needs to achieve a very large size in order for gravity to sculpt solid rock into a sphere. The Earth is more than large enough to do this and so is the moon. In fact the moon is abnormally large relative to the size of the Earth.
If you look at other moons in the solar system, they are typically very small compared to their parent planet. Our moon is only the fifth largest moon in the solar system but it is by far the largest relative to its parent planet (unless you still consider Pluto a planet). The task of explaining how the Earth ended up with such a large moon has been a tricky one for scientists. The simplest explanation would be that the Earth and moon formed at the same time. If this is true they should have approximately the same composition but they do not. In particular, the Earth has a large iron core but the moon has an extremely small iron core. Alternatively, many moons start out as wandering asteroids that are captured by their parent planet. Examples of this are Mars' moons Phobos and Deimos. However it is very unlikely that the Earth would have been able to capture such a large object into a stable orbit. It also doesn't explain the striking similarities in the chemical makeup of the Earth and the Moon.
The leading explanation so far is that the Moon resulted from a collision between the early Earth and some other rocky planet. Computer models have shown that such a collision would produce a swath of debris that would eventually coagulate into an object with the Moon's orbit.
So now we have the Earth and the Moon but these two places were still very different than they are today. Both would have been extremely hot after their formations and subject to constant bombardment by other pieces of debris that would continue flying around the inner solar system until they either collided with something or were flung out into further orbits by the planets. We would have to wait a few hundred million years before things would change on Earth in a way that has never been seen anywhere else in the universe that we have explored.