Serena Williams has recently spoken about how she learned to manage her “debilitating” migraine.

Williams has been dealing with a migraine for years, but she revealed last year that it became debilitating since the pandemic began.

The 39-year-old Grand Slam champion came to realize that her migraine was triggered by stress, “or just overworking at my computer.”

Williams told PEOPLE that she was “just so used to playing through pain,” and those migraine attacks were different from the pandemic migraine attacks she was suddenly facing.

She explained, “I think things that I’m not used to — because I don’t usually do it 24/7 — like working on my venture fund and taking care of a child and doing my fashion company.”

Williams started looking for a solution to overcome her intense migraine attacks. Her doctor advised her to start taking Ubrelvy (ubrogepant), a drug that stops migraine attacks. She takes the medicine when she feels one coming on, which according to her brings her “relief.”

Ubrelvy is used to treat migraines and it may work by changing the amount of a certain natural substance in the brain, according to WebMD. It helps to relieve headache, pain, and other migraine symptoms, including nausea, vomiting, and sensitivity to light/sound.

This medication is not used to prevent future migraines or lessen how often you get migraines.

Also, the athlete learned how to set “boundaries” with her work.

She said, “I have really good boundaries now, so I know when I’m supposed to do things and what I’m not supposed to do things. So I know when I play tennis, I know when I do my business. Migraines are attacks that I don’t try to have.”

It also means that she can now spend time with her 3-year-old daughter Olympia without feeling the pain.

Williams said, “It was harder for me to sit there and say, ‘I can’t go to the park because I’m not feeling well.’ I would say I have a boo-boo, and I had to just work through it in the past.”

She said she has not faced any issues at home or on the court since she found the solution to her migraine.

Unlike past matches where she had to push hard through a migraine attack, she said she felt “great” during the 2020 U.S. Open and the 2021 Australian Open.

She said, “I don’t know if I’ve had any migraine attacks since I’ve started taking Ubrelvy, to be honest. And thank goodness, because they’re debilitating and it can be really awful to deal with.” The story was published on PEOPLE.