A recent health scare had Liam Hemsworth rethinking a major component of his life: his diet.

In an interview with Men's Health, Hemsworth opened up about his life and what led him to a hospital visit in 2019.

Hemsworth discussed training for his new television show, "The Most Dangerous Game," in which he plays a runner.

CHRIS PRATT TROLLS BROTHER-IN-LAW PATRICK SCHWARZENEGGER OVER INSTAGRAM PHOTO CREDIT

"I spent most of the project running and getting beaten up. It was just brutal. I leaned out a lot. Running is so jarring. Your knees, your ankles, your lower back," he recounted.

Liam Hemsworth. (Men's Health)

Afterward, Hemsworth turned to high-intensity workouts: "A mix of calisthenics, sled pulls, sled pushes, and lots and lots of free weights."

When asked whether his diet changed, Hemsworth explained that a scary experience prompted him to focus on changing his diet.

"I was vegan for almost four years, and then February of last year I was feeling lethargic. Then I got a kidney stone," he revealed. "It was one of the most painful weeks of my life. I was doing press for 'Isn’t It Romantic.' But I had to go to the hospital and get surgery."

GOLDIE HAWN ON HER RISE TO FAME IN HOLLYWOOD: 'I WAS UNSETTLED'

Hemsworth noted that he's "all good now," but the risk getting a second kidney stone is 50 percent if you maintain your diet.

"Well, my particular kidney stone was a calcium-oxalate kidney stone. It forms from having too much oxalate in your diet," said the "Hunger Games" star. "Oxalates are really high in a lot of vegetables, specifically spinach, almonds, beetroot, potatoes. Every morning, I was having five handfuls of spinach and then almond milk, almond butter, and also some vegan protein in a smoothie. And that was what I considered super healthy."

He added: "So I had to completely rethink what I was putting in my body."

Liam Hemsworth had to rethink his diet after getting a kidney stone. (Men's Health)

Hemsworth said he made the decision to turn to veganism for health reasons.

"It was right before I started shooting 'Independence Day: Resurgence.' The first two years, I felt great. My body was strong, my cardio was high," he recalled. "What I say to everyone is 'Look, you can read whatever you want to read. But you have to experience it for yourself. You have to figure out what works best for your body.'”

HILARY DUFF DITCHES BLONDE HAIR FOR BOLD, NEW LOOK: 'YEA'

The actor provided fans with one last piece of advice when it comes to diet: "And if something works well for a period, great, keep doing it. If something changes and you’re not feeling great, you’ve got to reassess it and then figure it out."

He also said that he's been utilizing ice baths to maintain his fitness.

Liam Hemsworth has been a vegan for several years. (Men's Health)

"When I’m working out really hard, if I’m including an ice bath among all that, my recovery is better," Hemsworth explained. "When you come out of an ice bath, your body feels electric and your senses are heightened."

CLICK HERE TO GET THE FOX NEWS APP

"The Most Dangerous Game" is currently streaming on Quibi and follows the story of a man being voluntarily hunted for sport over the course of 24 hours, hoping to win enough money to pay for treatments for his terminal illness.