what prevents the gravity of the sun to pull all of the planets towards in

The gravitational force between the Sun and the planets is responsible for keeping the planets in their orbits rather than allowing them to be pulled towards the Sun. This is due to the combined effects of the planets' orbital speed and their distance from the Sun.

1. Orbital speed: Each planet in our solar system has a certain velocity, or speed, in its orbit around the Sun. This velocity creates a centrifugal force that counteracts the gravitational force from the Sun. The combination of the gravitational pull inward and the centrifugal force outward balances out, resulting in a stable orbit.

2. Distance from the Sun: The strength of gravity decreases with distance. The farther a planet is from the Sun, the weaker the gravitational force it experiences. This helps to counterbalance the gravitational pull toward the Sun, allowing planets to stay in orbit at a certain distance.

The balance between the gravitational force, orbital speed, and distance ensures that the planets remain in stable, elliptical orbits around the Sun and prevents them from being pulled directly into the Sun.