The reason you can walk on the surface of celestial bodies like the Moon or other planets, but not on Earth, has to do with the composition and structure of these bodies.
The Moon and other solid celestial bodies have a solid surface, which you can physically walk on. They are composed primarily of solid materials such as rock, regolith (a layer of fragmented rocks and dust), or even ice in some cases. These bodies have a relatively thin or no atmosphere surrounding them. The absence or thinness of an atmosphere means there is no significant barrier or medium to impede your movement on the surface.
On the other hand, Earth has a substantial atmosphere, composed of gases such as nitrogen, oxygen, and trace amounts of other gases. This atmosphere extends several kilometers above the Earth's surface. When you "walk on Earth," you are walking on the solid surface of the planet, which is covered by a variety of materials like soil, rock, water bodies, etc. However, you are still within the Earth's atmosphere.
The atmosphere exerts pressure on the Earth's surface and interacts with it in various ways. As you move through the atmosphere, you encounter air resistance, which opposes your movement and makes it impossible to "walk on air." The density of the atmosphere gradually decreases with altitude, but it doesn't abruptly end like the surface of the Moon or other planets. Therefore, you need to remain within the solid surface of Earth to walk, as the atmosphere is not a supportive medium for walking.
In summary, the ability to walk on the surface of celestial bodies like the Moon is possible because they have a solid surface without a substantial atmosphere. On Earth, the presence of an atmosphere creates air resistance and necessitates staying within the solid surface of the planet to walk.