The astronauts aboard the International Space Station aren’t actually weightless. Gravity still exists in space, we know this because the gravity of the Moon and the Sun effect the Earth. The astronauts only appear weightless because they are orbiting Earth.
Earth’s gravity on the astronauts acts as a centripetal force. So they are being pulled downward towards Earth’s surface, but they keep the station moving fast enough forward such that they essentially fall around the planet rather than towards it. The astronauts therefore appear weightless because they are in perpetual free fall. This is exactly the same phenomena that keeps the Moon orbiting the Earth, and the Earth orbiting the Sun.