From pushing herself to get an intense workout done, to finding a new fitness regime that makes her feel good in her skin, Mindy Kaling has definitely come a long way.

The 42-year-old "Mindy Project" alum opened up about her weight loss journey and how she was able to hit her targets, not just with her fitness routine, but also through her mentality.

"I've tried really hard to let go of this idea of losing weight for vanity reasons and really trying to think of how I can be healthy. And for me, healthy is working out, moving my body a lot, keeping hydrated, and then not having negative connotations around working out and making me feel like if I don't do this, then I won't be something else," Kaling told People.

"And that's taken a long time to kind of shed those old ideas of working out," she added.

Even though fitness has been a part of Kaling's life since her early 20s, she no longer sees it as a form of punishment.

"When I was younger, I had a very specific idea of how working out needed to be. It was like 45 minutes on the treadmill, seven-minute mile, it needed to be punishing, I needed to hate it," she said.

But today, Kaling, who calls herself a "complete hobbyist" while working out, says she remains active by just moving her body — with jogging, walking, yoga, pilates, strength training, tai chi and more.

"I don't have to be like the expert at the thing to really enjoy it and to get a great workout. Surprising the body with lots of different things I think is really good, particularly for my body … I've really been mixing it up and knowing that if a workout doesn't necessarily make me soak my clothes with sweat, that it still was a good workout… It does not have to be punishing," Kaling explained.

"And I'm 42 now, right? So I have to do stuff like that for me, in order to be able to be active with my little kids," she added. Kaling has two kids — 4-year-old daughter Katherine "Kit" Swati and 1-year-old son Spencer Avu.

Mindy Kaling oscar party 2018
Mindy Kaling attends the 2018 Vanity Fair Oscar Party hosted by Radhika Jones at Wallis Annenberg Center for the Performing Arts on March 4, 2018 in Beverly Hills, California. Dia Dipasupil/Getty Images

"The endorphins that I get from working out center me. I'm kind of an anxious person and it makes me feel centered and makes me more focused. And I have some of my best creative ideas when I'm working out," Kaling said. "It's made me feel so confident. It's made me feel so great and own the fact that I love working out."

After all, this is a huge change for her, given that working out wasn't really a thing while she was growing up. "I never felt that kind of confidence to be like, 'Yeah, actually, I do work out four to five times a week. Can you believe it?' I always felt like I had to be sheepish about it," she shared.

Kaling had previously spoken about how portion control while eating helped her shed that extra weight, especially after giving birth to her two babies.