The 23-time grand slam champion beat Nuria Parrizas-Diaz 6-3 6-4 in the opening round in Toronto, securing her first singles victory since a defeat of Danielle Collins at the 2021 French Open.
Williams returned from a one-year absence at Wimbledon last month after recovering from injury, but was beaten by Harmony Tan in the first round.
The long-awaited win in Toronto was her first since turning 40 and it gave the American a timely lift ahead of the US Open.
"I guess there’s just a light at the end of the tunnel," she said. “I don’t know, I’m getting closer to the light, so… lately that's been it for me. I can’t wait to get to that light."
When asked what "the light" means to her, she responded "freedom".
"I love playing though, so it’s like, amazing," she added. "But, you know, I can’t do this forever.
"Sometimes you just want to try your best to enjoy the moments, and do the best that you can."
Williams became just the fourth player since 2000 to win a WTA-Tour level main-draw match after turning 40, along with Martina Navratilova, Kimiko Date-Krumm and her sister Venus Williams.
It also gave her the all-time lead for wins at the Canadian Open in the Open Era, this being her 35th victory at the event to break her tie with Chris Evert.