You’re getting older.

And with aging comes a certain amount of change, especially when it comes to your body.

Activities that you could easily do in your 20s now require a bit of caution — if not a note of permission from your primary care physician.

Luckily, you can continue to be physically active well into your golden years, provided you’ve established a good foundation early on.

And even if you haven’t, it’s never too late to get (back) into shape.

Exercise is the ultimate anti-aging treatment.

Researchers are emphatic about the between exercising and fitness and the body and mind, contributing to a decreased prevalence of injury, illness, and other negative aspects of getting older.

Here’s how to combat the effects of growing older and achieve peak performance condition no matter what your age.

Read more: How long does it take to get in shape? »

Exercising in your 30s

With your at their peaks, now is the perfect time to lay the foundation for a long-term relationship with fitness.

Your league sports games and pickup matches may be less frequent, but that should allow you the time and energy for other activities.

High intensity cross training or circuit training with cardio and resistance (i.e., weights) will help you develop overall fitness, which may be lacking if you have always participated in just one or two sports.

It will also help prevent injuries.

Exercise in at 80 to 95 percent of your max, interspersed with recovery pauses to allow your heart rate to return to normal.

High intensity interval training (HIIT) has been shown to be more effective than prolonged cardio-only training.

Women, in particular, should start prioritizing intense strength training as won’t be as effective as they once were.

Aim to exercise five times a week with one day reserved for high intensity cardio (at least 45 minutes). Switch your routine up often to avoid diminishing returns, and plan for a once-a-week rest day.

Your exercise regimen should also include balance and flexibility training. This will become more important as you age. Low-impact activities like yoga, tai chi, and dancing integrate stretching and breath work into movement. (Bonus: yoga, for one, has been proven to by increasing your brain’s GABA levels.)

Just don’t let up: Your metabolism has already begun , requiring doing more exercise and taking in fewer calories to avoid putting on fat.

Don’t leave proper form at the gym: Walk upright, focusing on keeping your abs activated to avoid hunching later in life. And always take the stairs.

Featured exercise: Burpees

These full-body exercises will quickly and efficiently wear you out (in a good way). They require no special equipment — all you need is a timer — and can be done just about anywhere.

Get into a squat and position your hands on the floor in front of you.

Kick your feet straight back while lowering yourself into the “down” part of a pushup, arms bent at 90 degrees.

Jump your feet back to their original position while pushing your torso up with your arms.

From the squat, jump straight up, as high as possible, reaching your arms toward the ceiling or sky.

Come back down into a squat and repeat the series of movements, moving from one position to the next as quickly as possible.

Start by doing 20 seconds of burpees, resting for 10 seconds, and repeating eight times, for a total of four minutes.

Extend the amount of time you spend moving between rest periods or increase the total amount of time you spend doing the exercises.

Read more: Are expensive fitness classes worth it? »

Exercising in your 40s

Welcome to the official start of middle age.

A combination of more time sitting at a desk job, , and a naturally occurring muscle mass loss — with men dropping of their muscle mass every decade after they turn 40 — makes for a slower metabolism and the seemingly inevitable middle-aged paunch, increasing the chances for a bad lower back.

On top of that, your fat distribution will change internally, putting additional weight on and around your organs and increasing the risks of heart disease, diabetes, and cancer.

The good news?

You still have great potential to reverse decades of aging and improve your body shape while upping your energy levels.

In fact, will ward off cardiovascular disease and diabetes.

Keep up a consistent exercise regimen to preserve lean muscle mass and keep fat gains minimal. Even 10 minutes of activity is better than none.

Continue training with weights three to four times a week, and up the cardio to five times a week, reserving one day for rest.

In terms of strength training, remember quality over quantity. Focus on doing the movements slowly and with control.

Now is the time to make stretching a priority. Invest a few bucks in a foam roller. It will help with your flexibility by loosening and relaxing muscles.

Maintaining or improving flexibility will be crucial in the years ahead.

Featured exercise: Squat

A staple of most gym workouts, the squat directly affects the large muscles of your legs — quads, hamstrings, and calves — and also promotes overall muscle gain which in turn helps burn fat. Squats also help improve your balance and mobility.

Stand with your feet shoulder-width apart.

Lower yourself down by bending your knees, pushing your hips back, until your thighs are at least perpendicular with the floor.

Keep your back flat and avoid allowing your knees to move forward beyond the length of your feet.

Pause at the bottom, then activate your leg muscles to raise yourself back up.

Initially, your bodyweight will be sufficient as you learn to perform the movements with proper form and control.

With time you can add intensity by positioning a barbell across your shoulders or holding dumbbells in both hands.

Read more: What exercises are the best? »

Exercising in your 50s

You are likely experiencing more drooping as you lose muscle tone and your shoulders start to .

Focus on saving your back by strengthening your core muscles and keeping good posture. Yoga and Pilates are helpful for both.

You may also discover that the soreness and fatigue the day after a workout is becoming more than occasional.

Some activities may exacerbate pain, so alter your exercise routine accordingly rather than letting it discourage you from exercising at all.

If your knees are bothering you from running, try riding a bike or swimming instead.

You will also need additional recovery time after a hard workout, so go easy — aim to exercise more frequently but with a moderate level of intensity. Ideally, get in a half-hour of cardio every day. Studies show that regular exercise will , keeping your muscles and lungs healthy.

Train with weights twice a week and develop an affinity for the kettlebell as it is good for complex exercises.

Be fanatical about stretching hard after every workout.

Featured exercise: Sun Salutations

A Sun Salutation — Surya Namaskar, in Sanskrit — is a specific series of yoga poses that flow from one to the next.

Typically used as a warmup in yoga classes, Sun Salutations stretch and strengthen all the major muscle groups. Linking movements to breathing also helps reduce stress.

Stand with your feet hip-width apart.

Press your palms together in front of your chest.

Sweep your arms out and overhead while inhaling.

Exhale as you fold forward at your hips, reaching your hands toward the floor and bending your knees as necessary.

Inhale as you lift your torso up halfway, bringing your back to parallel with the floor, open palms pointed toward your shins.

Exhale as you step your feet back one at a time or jump both feet back together to come to a plank pose, continuing to exhale as you lower your body to the floor by bending your elbows.

Inhale as you straighten your arms, extending your chest forward, and drawing your shoulders back.

Exhale as you lift your hips, pushing down with your hands and feet to lengthen your spine.

Take five breaths.

On your last exhalation, bend your knees and look forward between your hands. Inhale as you step or jump your feet in between your hands and again lift your back halfway, bringing your back parallel with the floor and pointing your fingers toward your shins.

Exhale as you fold forward at your hips, again reaching your hands towards the floor and bending your knees as necessary.

Inhale as you sweep your arms out and overhead. Exhale as you bring your palms together in front of your chest.

Repeat.

Read more: Exercise and weight loss »

Exercising in your 60s

Although you may still be planning to become a world-class bodybuilder or swimsuit model at 65, your goal should now be prevention — preventing disease, such as diabetes and heart disease, falling, and frailty.

Regular exercise is still the way to go, with emphasis on maintaining balance and strength.

Weight training is a must, ideally three times a week, alternating between upper and lower body muscle groups and using light weights. Your bones are a bit and the tendons and ligaments holding you together aren’t as supple as they once were, so be careful. Better yet, work with a professional trainer to avoid injury.

Low-impact group exercise classes like Zumba and water aerobics will get your blood flowing without adding strain. And working out with others should make for comradery and accountability around working out.

Group walks, for instance, have been shown to have when compared with solo walking.

Aim for three days a week of moderately intense cardio.

If you run, take heart: an hour-and-a-half of slow to moderately paced jogging over the course of the week could by as much as five years, according to research.

Incorporate balance exercises and stretch, stretch, stretch.

Featured exercise: Single-leg deadlift

Isolateral exercises like the single-leg deadlift work one side of the body at a time, as opposed to training both sides at once.

This allows training to continue around an injury and also corrects strength asymmetries. Most importantly, they improve general balance and equilibrium.

Stand on one leg, firmly planting your toes and heel into the floor.

Slightly bend your standing leg as you extend your free leg behind you, leaning forward with your torso and reaching your arms towards the floor.

Continue to lower yourself until your torso is parallel to the floor. Lift yourself back up slowly and with control.

Increase intensity by adding a weight — a kettlebell is ideal. Hold the weight in the hand on the same side as your standing leg, lowering it in front of you as you bend down.

Return the weight to your side as you return to the upright position.

Read more: Exercise for seniors »

Exercising past age 70

Exercise is beneficial at every age. Continuing to work on your strength, flexibility, and balance will keep you spry and independent long past 70.

It will also help you , according to a recent study. And though your morning constitutional walk is a perfectly fine starting point, don’t stop there.

Incorporate stretching and working light weights and resistance bands into your regimen. Staying strong will increase your chances of surviving a fall; women in their 60s and 70s have a of dying within a year of suffering a hip fracture.

When working out, be sure to check in with yourself when you experience pain as it may necessitate changing up your exercises. If the pain continues, visit your doctor.

Featured exercise: Heal-to-toe walk

Improving your balance and stability will decrease your chances of falling and make going up and down steps easier.

If you feel unsteady on your feet, do this exercise alongside a wall so you can steady yourself as necessary.

Position the heel of one foot directly in front of the toes of the other foot so your feet are nearly touching.

Focus on a spot ahead of you and take a step, placing your moving foot’s heel directly in front of the toes of your stationary foot.

Repeat.