It took a long time for the matter produced in the big bang to form galaxies, stars, and eventually Earth.
Gradually, as the spinning, whirling bits of matter from the big bang flew off into space, larger and larger chunks collided with each other. These chunks drew together to form suns, planets, moons, stars, and asteroids.
About 5 billion years ago, a certain medium-size star exploded into existence. Its matter collapsed on itself, causing incredible pressure and heat. This became our Sun. The gravitational energy around the newly formed Sun attracted nearby chunks of matter.
These began to orbit the big star, or to travel in a circular path around it. Earth was one of those collections of matter. At that time it was a hot ball of thick dust, mineral particles, and gas—not what we imagine when we use the word Earth.