Why does the earth orbit the sun rather than be pulled into it?
This is a very good question!
I'll try to give you a visual example first (not mine but from the master, I. Newton):
We can see that the object (in this case a bullet) fired from the mountain at
On the other hand if the initial velocity is too high the bullet will spiral out and escape.
Transfer this to the Sun-Earth system; at the start of s8lar system formation Earth acquired enough velocity to continuously fall like the bullet.
Hope it helps.