How Did Earth Form
Let's go back, way back! 4.6 Billion years ago, the little blue ball that we call home was created.
Before we talk about the Creation of Earth, we must discuss how the solar system formed. About 4.6 billion years ago, a dense cloud of gas and dust collapsed due to a supernova. When the cloud collapsed, it created a spinning disk of stuff or in nerd terms a Solar Nebula. Over time, the Earth & all the other plants in the Solar System would be created by the remnants of dead stars.
Why can we live on Earth
You can never talk about Earths origin without talking about life's origin. Earth has life because we are in the Goldilocks zone. This means Earth isn't to close to the Sun like Neptune or to close to the Sun like Mercury.