The first step toward achieving the moonwalk are the shoes. The shoes need to have an extremely smooth sole. You are going to be sliding your shoes, so the less friction created, the easier it will be. Socks will provide the smoothest footwear.
To help the smooth shoes, you need to have a smooth floor. Again, there needs to be almost no friction between your feet and the ground. Any linoleum floor will work, as well as most kitchen floors. The moonwalk will be extremely difficult to master on carpet or cement.
Stand straight up. Have your left foot slightly in front of you with your right foot slightly behind you. Your right foot's heel should be off the ground with the toe pointing down to the floor.
With the right foot's heel still off the ground, slide your left foot backwards until it is behind your right foot. As the left foot comes closer to the end of its slide, begin to raise its heel up. At the same time, the heel of the right foot should begin to come down to the floor. By the time the left foot has finished sliding, it's heel should be completely off the ground with toes pointing to the ground, and the right foot's heel should be on the ground, ready to slide backwards. Now, repeat the movement with the right foot sliding back.
The moonwalk can be a challenging move to learn. Start off with small, backwards foot glides. As you begin to grow comfortable with it, increase the length of your glides to get a greater effect of the moonwalk.