The earth is just the right distance from the sun—an average 93,000,000 miles. If the earth were much closer to the sun or farther away from it, temperatures would be too hot or too cold for life.
Although they measure the distance with a different system now, Coreys answer is basically correct. Read this info on this site and it will explain it all for you.
How Far is Earth from the Sun? - Space.com
www.space.com/17081-how-far-is-earth-from-the-sun.html
Space.com