Jennifer Lopez opens up about panic attack brought on by exhaustion: 'I was so terrified I thought I was losing my mind'

Jennifer Lopez is getting real about an underrated beauty secret: sleep.

In an excerpt from the actress and singer's newsletter, On the JLo, she opened up about how a panic attack led her to realize the importance of getting her enough shut-eye — as well as leading her to prioritize mindfulness and a work-life balance.

"We don’t value sleep," she wrote. "We value grinding and working hard — and admittedly, nobody gets caught up in that rat race more than me. I've found however, that sleep to me is the most underrated beauty secret out there."

“There was a time in my life where I used to sleep 3 to 5 hours a night," she explained. "I'd be on set all day and in the studio all night and doing junkets and filming videos on the weekends. I was in my late 20s and I thought I was invincible."

That all changed when she went from "feeling totally normal" in her trailer to feeling unable to move.

"I was completely frozen," she said. "I had made my work such an all-consuming priority and let my own self-care needs go completely (even as simple as sleeping or taking ten minutes to just relax). I found myself feeling physically paralyzed, I couldn't see clearly and then the physical symptoms I was having started to scare me and the fear compounded itself."

Lopez, 52, said she now knows it was "a classic panic attack brought on by exhaustion," but admitted that at the time she didn't have words to describe it.

"My security guard on set came in and picked me up and drove me to the doctor," she wrote. "By the time I got there, I could at least speak again and I was so terrified I thought I was losing my mind. I asked the doctor if I was going crazy. He said, 'No, you're not crazy. You need sleep ... get 7 to 9 hours of sleep per night, don't drink caffeine, and make sure you get your workouts in if you're going to do this much work.' I realized how serious the consequences could be of ignoring what my body and mind needed to be healthy — and that's where my journey to wellness began."

Since then, she's been working to achieve balance.

"As I slept more and took care of myself, I realized it was about pro-living versus anti-aging," Lopez said.

"I think of sleep like a little time machine," she continued. "You lay down and you go into a space where you preserve yourself and then you come out a new, younger person than you were before. Sometimes I wake up and say, 'Wow! I just lost 10 years off my face!' That's what a good night's sleep can do for you, and it accumulates over time."

The mom of two has previously spoken publicly about how prioritizing her mental health has been an ongoing journey.

In 2021, she opened up to life coach Jay Shetty about the lessons she's learned from going to therapy.

"I remember when I was going through therapy at the beginning, you know, kind of in my late 30s and there was a lot of talk about loving yourself and I was like, 'I love myself,'" she told Shetty. "But obviously I was doing all these things in like my personal relationships that didn't seem like I was loving myself, but I didn't even understand the concept of it. It took time and it's a journey and it's still a journey for me."

Want lifestyle and wellness news delivered to your inbox? Sign up here for Yahoo Life’s newsletter.