Tennis legend Serena Williams revealed she has some “serious boundaries” when it comes to her mental health.

The former world number one, who said that she will be retiring from tennis this year, spoke to Selena Gomez about how she takes care of her mental fitness.

“Mental fitness for me is just really learning to shut down,” Williams, 40, said on the “Only Murders in the Building” star’s wellness platform, Wondermind.

“I did this years ago before mental health was a topic among everyone’s mind. It was more just like, alright I’m shutting myself down today. Subconsciously it was something I’ve always done,” she continued.

“I have serious boundaries and I don’t let anyone cross those boundaries with time,” the mom-of-one added.

The 23-time Grand Slam winner said she makes sure that she has time off each day to check in with herself.

Gomez discussed mental fitness with the tennis superstar on her wellness platform, Wondermind.

“It’s so bad because I really don’t do anything for me, I’m terrible at that,” she explained.

“And I’ve said it time and time again, I’m working on it. But more or less, at least prioritizing what I need to do. And then when I’m turned off, I’m turned off.”

Serena Williams hinted that she will be retiring from tennis this year.

Williams has not stated precisely what her last event will be but did make it sound as if her final farewell will come at the U.S. Open, which begins Aug. 29 in New York.

Williams has won the singles title at Flushing Meadows six times — first in 1999; most recently in 2014 — to go along with seven championships apiece at Wimbledon and the Australian Open, plus three at the French Open.