On Wednesday, superstar Jennifer Lopez will add another considerable accomplishment to her list: The actor-singer-dancer is turning 50.

But to look at her “Jenny From the Block”-era abs and baby-smooth skin, you’d scarcely believe that the mother of two has been alive for half a century.

So what’s her secret?

“Here’s the thing,” the “Hustlers” star’s trainer, David Kirsch, tells The Post. “She’s a goddess, but she works it. Nobody gave her anything.”

Some of today’s biggest stars are blazing past major milestone birthdays looking even better than they did when they got famous in their 20s and 30s. Fresh-faced women of a certain age — such as Lopez, Julianne Moore and Halle Berry — appear to have cracked the code on aging, flaunting enviably toned physiques and youthful visages.

But as their teams of doctors, nutritionists, facialists and trainers reveal, it takes work to stay in role-winning shape.

Lopez, for instance, commits herself to a highly restricted diet — she consumes neither sugar nor dairy products — as well as a rigorous workout routine that involves daily circuit training.

“Our body responds to exercise differently when we age,” says Kirsch, who warns that fifty-somethings might need to dig a little deeper as they get older. “Hormones and biomechanics change… so what worked at 25 or 30 doesn’t necessarily work now.”

The same goes for skin care.

“It is unrealistic and unnatural-looking to get rid of wrinkles completely in patients over 50,” says Paul Jarrod Frank, a celebrity dermatologist who developed a skin care line with his star patient Madonna. Instead of a total surgical overhaul, he recommends a series of cutting-edge in-office “tweakments,” such as skin-brightening lasers and injectables, to his high-profile clients.

Read on to learn more about how to age like Hollywood royalty.

Work it like J.Lo

Lopez is out-of-this-world gorgeous, but the rules for normal, earthly women still apply.

“As you get older, you have to step up the intensity of your workouts,” says Kirsch. “You’ve also got to hydrate, eat well, get good rest, because the body’s ability to recover diminishes with age.”

For women over 50, Kirsch suggests adding weights in the form of 5- to 20-pound dumbbells to build muscle, and focusing on moves that target the abs and back, such as a series of planks: traditional hands-under-shoulders version, side planks, planks with dumbbell rows, etc.

The core, says Kirsch, is the “one body part that’s the barometer of the body’s overall fitness, and that’s where Jennifer gets an A-plus.”

And rather than relying on a treadmill or spin bike for cardio, Kirsch likes having older clients repeat a series of weight-based exercises in quick succession to raise their heart rates, since the moves tone the muscles as well.

Fast like Halle Berry

You won’t find 52-year-old Berry snacking on fruit for breakfast.

The actress adheres to a strict ketogenic diet, which involves limiting carbohydrate intake and fasting before noon to remain in a fat-burning state of ketosis.

She told followers of her #FitnessFriday Instagram series that she went keto a few years ago to help manage her type-2 diabetes but believes that the diet has “been largely responsible for slowing down [her] aging process.”

She’s also a big fan of Bulletproof Coffee, which Berry combines with butter and medium-chain triglyceride (MCT) oil and sips on an empty stomach.

The MCT coconut oil is “a really nice fat burner when you’re consuming it on a regular basis,” her trainer, Peter Lee Thomas, explained in one of Berry’s recent Instagram Stories. (Some studies back this up, although research is far from conclusive.)

Glow like Julianne Moore

For dewy, porcelain skin like Julianne Moore’s, the actress’s go-to facialist Joanna Vargas suggests a morning application of anti-oxidant-rich vitamin-C serum paired with a nightly retinol. She also provides high-tech in-office treatments like microcurrent facials, which tighten skin, and microneedling, which can fade scarring, every few months.

Vargas also swears by LED therapy, which uses certain wavelengths of light to heal and firm aging skin through a process known as photobiomodulation — perfect for 58-year-old Moore, who told Red magazine she shuns fillers and Botox.

“For somebody who is in their 50s or 60s, collagen production starts to slow down to almost a complete stop,” says Vargas. “LED light has been shown to build collagen…which translates to better elasticity.”

Vargas has clients relax in her NYC studio’s custom-made LED bed, which pumps red light over the entire body.

Can’t swing the $150 price tag for 20 minutes? Many aestheticians can now tack a short LED session onto the end of an appointment, and some beauty brands sell light-emitting masks for regular use.

Hydrate like Angela Bassett

Angela Bassett loads up on moisturizer — a move that wins Vargas’ approval.

“It’s harder to maintain hydration levels in the skin as we age,” says the facialist, who recommends oil-based serums for aging skin.

Bassett, now 60, even launched her own line of skin care products in 2016, teaming up with Dr. Barbara Sturm to engineer cleansers, creams and a serum for women with darker skin tones.

The line targets hyperpigmentation as well as breakouts and skin sensitivities, with which Bassett reportedly struggled.

The “Black Panther” star even moisturizes her eyelashes: “I use GrandeLash in the morning and Dr. Lancer’s lash serum at night; they’ve really helped my lashes grow,” she said in an interview with beauty brand Violet Grey.

Cover up like Nicole Kidman

For glowing skin like Kidman’s, slather on the SPF.

“Sunscreen is the key to anti-aging,” says Vargas. “Cell mutation and sun damage accumulate in the skin over time, so… people in their 40s and up see the effects of the sun more than younger people.”

Kidman’s love affair with sunscreen began as an attempt to avoid freckles during her childhood in ozone-poor Australia.

Now, the 52-year-old swears by SPF 100 to keep her skin fresh and free from cancer — a move that’s paid off over the years: The “Big Little Lies” star’s skin is age-spot-free with hardly a wrinkle. (Kidman told a German magazine in 2011 that she tried Botox once but hated the way it froze her face.)

Too late to avoid dark spots and other sun damage? Dermatologist Frank suggests the Fraxel resurfacing laser, a roughly $2,000 procedure that clears pigmentation and boosts collagen production in a one-two (only moderately painful) punch.

“The downtime is makeup-coverable for a few days, so even celebrities can fit it into their schedules,” he says.