At 42 years-old, Sofia Vergara has undoubtedly got one of the best bodies in Hollywood. However, like most people she would much rather enjoy stuffing her face with delicious snacks than going to the gym, but the actress may have found a way to stop these food cravings from effecting her desirable figure.

Sofia Vergara
Vergara has an amazing body for a 42 year-old

Vergara recently spoke candidly about fitness in the November issue of Shape magazine, which she features on the front cover of - displaying her toned figure in a pair of black bikini bottoms along with the headline "Sofia Vergara: How She Got Her Best Body at 42."

"I heard about someone in L.A. who got hypnotized so they wouldn't eat candy. I'm seriously looking into that because I'm obsessed," she told the mag. "Everyone knows that I've never been into working out, I was always very happy with what I have. Then I hit 40 and I started seeing a softness everywhere on my body."

More: Sofia Vergara Recalls Joe Manganiello Being Caught Checking Out Her Behind At The White House Correspondents' Dinner

The 'Modern Family' actress suffers with "bad knees" so running isn't part of her fitness routine, instead she opts for the Lagree Fitness Method workout with Pilates and Megaformer machine touches. "With this machine, I was able to figure out what worked for me. I don't love it at all, but I love how my body's changing," she said.

More: Once Again Sofia Vergara Earns Top Spot On Forbes' List As Highest-Paid TV Actress

"My body is looking better than it used to, but I wish I had worked out more when I was younger and taken it as seriously as I do now," Vergara confessed. "My niece is 21 and she loves exercising, and I tell her, 'Keep doing it so you don't have to go crazy with it when you're my age!"