How was Earth formed?

How was Earth formed?