Jennifer Lopez wrote a candid message to her fans about the importance of rest.

In the latest issue of her personal fan newsletter, On the JLo, the singer, actress, and entrepreneur opened up about an incident during her 20s where she discovered she wasn’t as “invincible” as she thought.

“There was a time in my life where I used to sleep 3 to 5 hours a night,” she wrote. “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. Until one day, I was sitting in a trailer, and all the work and the stress it brought with it, coupled with not enough sleep to recuperate mentally, caught up with me.”

Related article: Jennifer Lopez On Why She Almost Quit Hollywood For Good

She recalled that in a split second, she felt like she was “paralyzed.” She was then taken to the doctor by her security guard, and the physician told her she needed to rest.

“I couldn’t see clearly and then the physical symptoms I was having started to scare me and the fear compounded itself. Now I know it was a classic panic attack brought on by exhaustion, but I had never even heard the term at the time,” she wrote.

“[The doctor] 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,'” she continued. “I realized how serious the consequences could be of ignoring what my body and mind needed to be healthy.”

Related article: Jennifer Lopez Wears A Perfect Airy Weekend Dress In LA

In recent years, Lopez has opened up more about her physical and mental health, sharing stories about her journey to a healthy work-life balance in both her newsletter and her Netflix documentary Halftime. In an earlier issue of On the JLo, the star wrote that she plans to prioritize her personal life, including time with her kids and her fiancé, Ben Affleck.

“It’s super important for me, especially now, to prioritize my personal life and not just my work life. When I had kids 14 years ago was when I started thinking differently,” Lopez wrote, referring to her twins Max and Emme Muñiz. “Things changed for me. Little by little, my perspective has turned into a healthier work-life balance.”

“Now that I’m getting married, it’s about my family first and foremost,” she continued. “It’s about having enough time to be the woman, the mother, the partner and the person that I need to be for the important people in my life. It must be a very special project if it’s going to take time away from my family.”

This article originally appeared in Harper’s BAZAAR US