Knee pain during heavy squats is not inevitable if you’re using proper form. But that pain could also be a sign of patellofemoral pain syndrome—or a misaligned kneecap—which isn’t good.

These tips should help:

1. Wear the right shoes

Be sure you’re wearing sneakers with the right support—please, no squatting in squishy running shoes. Wear flat-footed shoes made for lifting, or even a pair of Chuck Taylors.

2. Keep your heels glued to the ground

Don’t let your heels come off the ground when you squat—that can push your knees too far forward and cause strain. Flat-soled shoes will help you sit back on your heels, too.

3. Nail your squat form

Box squats can also help you master proper form. Squat in front of a box about 15" high, or high enough that your thighs are below parallel when your butt hits the box. Set your feet wider than your hips, and angle your toes out 15 to 30°.

4. Strengthen your joints

Finally, build up stability in your knees and ankles by doing moves that strengthen them from different angles under different loads, like walking lunges and prowler pushes.

But 'till the pain goes away, try an anti-inflammatory like aspirin, and ice your knees nightly for 20 to 30 minutes.

Gunnar Peterson is a Beverly Hills-based celebrity trainer and columnist for Men's Fitness. Follow him on Twitter.