Reese Witherspoon revealed she once underwent hypnosis to treat panic attacks that were caused by a movie role.

The Legally Blonde alum revealed to Tracee Ellis Ross and Interview magazine that one of her movie roles "changed [her] on a cellular level."

When asked what role changed her the most, Witherspoon said that playing Cheryl Strayed in the 2014 drama Wild tested her in more ways than one.

The film follows a woman who hikes over 1,100 miles alone while attempting to recover from traumatic events.

"I was so scared to do that, Tracee," Witherspoon admitted, sharing that she began to suffer from panic attacks three weeks before filming began. She turned to hypnosis to combat her mental health struggles.

"There was the nudity, sexuality, and drug-use aspect," she said of the role. "But also being alone on camera with no other actors. I hadn’t ever been alone in scenes for days and days. There were probably 25 days of the shoot where I had no other actor opposite me. It was just me and a camera and a backpack. I was like, 'Is this going to be so boring?'"

"I thought it was radical that at the end of the film, she ends up with no family, no money, no job, no partner, and she’s happy," the actress added.

Now, Witherspoon believes that she will never work as hard as she did during the film.

The 45-year-old actress has previously been open about her mental health. She told the "I Weigh" podcast that she began therapy at age 16, and she also revealed that she has dealt with anxiety and depression over the years, along with postpartum depression following the births of her three children.

Celebrities Who Opened Up About Mental Health

More From 99.1 WFMK