In fact, Newton solved this problem as early as 1687. In the Mathematical Principles of Natural Philosophy published that year, the greater the mass, the greater the gravity of an object, but its gravity intensity is inversely proportional to the square of the distance. Although the sun's gravity is strong, the revolution speed of the planets in the solar system is also different. Our earth has been revolving around the sun at a speed of 29.78 kilometers per second, and the "centripetal force" produced by the sun's gravity is the same as the centrifugal force produced by the high-speed revolution of the earth. Because there is almost no resistance in space, the earth can keep this speed for a long time and never fall to the sun.
Modern astronomical observation proves that the closer a celestial body is to the sun, the greater the sun's gravity, so it needs a higher revolution speed to ensure that it will not fall into the sun by the sun's gravity, which is why Mercury's revolution speed is as high as 47.89 kilometers per second, while Neptune is only 5.43 kilometers per second. It is under the precise immune balance that our solar system can exist stably and our earth can last forever.