The Earth is thought to have been formed about 4.6 billion years ago by collisions in the giant disc-shaped cloud of material that also formed the Sun. Gravity slowly gathered this gas and dust together into clumps that became asteroids and small early planets called planetesimals. These objects collided repeatedly and gradually got bigger, building up the planets in the Solar System, including the Earth.
The details of how the Earth formed are still being worked out. Scientists study meteorites and the oldest rocks on Earth to understand what happened in these earliest times in the Solar System. They also observe other solar systems in our galaxy, the Milky Way.
Okay then, lets watch the video:
A Journey Through Time: Planet Earth 4,499,999,000 Years Ago: