Tamping is the act of pressing the coffee grounds into a flat, even puck in the portafilter. It's the foundation of espresso extraction.
Here's the secret to tamping: pressure. You need to apply consistent, even pressure. I recommend 30 pounds of pressure. But the exact number matters less than the consistency. If you tamp with 20 pounds one day and 40 pounds the next, your shots will be inconsistent.
Use your whole body. Stand over the portafilter. Put your hip into it. Your elbow at a 90-degree angle. The tamp should be level. If it's crooked, the water will channel through the coffee and the extraction will be uneven.
I've seen baristas tap the portafilter to knock down the grounds. Don't do that. Tapping can cause cracks in the puck, which leads to channeling. Just grind, level, and tamp.