How was the Earth formed?
I don't know who voted down your question. I'm guessing those who voted it down thought that prior to asking your question you could have searched on the internet to find out how the Sun and the solar system, including Earth formed.

I've just found the following two links by doing just that. The following quote is from one of them and it explains the current theory/model for the formation of the solar system:

From Birth of the Earth


  Long, long ago (some 5 billion years ago) in a perfectly ordinary place in the galaxy, a supernova exploded, pushing a lot of its heavy-element wreckage into a nearby cloud of hydrogen gas and interstellar dust. The mixture grew hot and compressed under its own gravity, and at its center a new star began to form. Around it swirled a disk of the same material, which grew white-hot from the great compressive forces. That new star became our Sun, and the glowing disk gave rise to Earth and its sister planets. We can see just this sort of thing happening elsewhere in the universe.


Read this article from Wikipedia as well.

https://en.wikipedia.org/wiki/Formation_and_evolution_of_the_Solar_System#Formation_of_planets