The American superstar was widely vilified for her New York outburst in which she branded the chair umpire a "liar" and "thief".
She was handed a code violation for coaching,docked a point for smashing her racquet and penalised a game for verbal abuse.
"I couldn't find peace. I started seeing a therapist," Williams wrote in a first-person account published in US glossy magazine Harper's Bazaar.
"I was searching for answers, and although I felt like I was making progress, I still wasn't ready to pick up a racquet."
Williams's essay appeared online and on her own Instagram account in the middle of her Wimbledon quarter-final defeat of Alison Riske on Tuesday.
In it, she says she has apologised to Osaka, the breakout Japanese star who won the US Open final in straight sets.
"I am so proud of you and I am truly sorry. I thought I was doing the right thing in sticking up for myself. But I had no idea the media would pit us against each other," said the 37-year-old Williams.
"I would love the chance to live that moment over again. I am, was, and will always be happy for you and supportive of you.
"I would never, ever want the light to shine away from another female, specifically another black female athlete."
Williams said that Osaka, who went on to take the Australian Open title and the world number one spot, had accepted her apology.
Osaka's reply, she insisted, had even moved her to tears.
Despite her apology, Williams still insists she was a victim of sexism at Flushing Meadows.
"Why is it that when women get passionate, they're labeled emotional, crazy, and irrational, but when men do they're seen as passionate and strong?
"So often, in situations similar to mine, when men fight back against the referees, they're met with a smile or even a laugh from the umpire, as if they're sharing an inside joke.
"I'm not asking to avoid being penalized. I am asking to be treated the same way as everyone else. Sadly, that's simply not the world we currently live in."
After partnering Andy Murray in the mixed doubles on Tuesday, the American said it had been a tough decision to seek counselling.
"It wasn't very easy. I've had a lot of things happen to me at that particular tournament in general," she explained.
"It was just important to always try to better yourself in any way that you can."