You may have seen the hammer throw in athletics events. When the athlete swirls their hammer, the cord between the athlete's hands and the hammer stop it from moving away from the athlete - until they let go of course! The hammer will then fly away in a straight line.
A hammer thrower in action
This is similar to how the Earth travels in orbit around the Sun, with one difference: there is no cord holding the Earth in orbit; instead, it is the force of gravity.
Gravity stops the Earth and all the other planets and moons from just drifting through space in a straight line. Essentially, it keeps them in orbit.
The planets in orbit around the Sun
As can be seen in the diagram of the Solar System above, the planets closer to the Sun have a more curved orbit, because the force of gravity from the Sun gets stronger the closer you get to it.
The force of gravity is also responsible for keeping the Moon orbiting around the Earth. Without the Earth's gravity, the moon would just drift away into space.
The Moon orbiting the Earth
The force of gravity can also keep our artificial satellites in orbit around the Earth without the need for power, because gravity from the Earth holds them in position. Similar to how the planets orbit around the Sun, satellites that are closer to the Earth orbit faster and on a more curved path than those that are further from the Earth.
A satellite orbiting the Earth