The 20-time grand slam champion announced last week he will bring an end to a highly decorated career after the upcoming Laver Cup.
Speaking to BBC Breakfast, Federer admitted his disappointment in being forced to retire through injury, but reflected on one of the most impressive careers the sport has ever seen.
"The last three years have been tough to say the least," he said. "I knew I was on very thin ice for the last year ever since I played Wimbledon.
"I tried to come back but there was a limit to what I could do. And I stopped believing in it, to be honest."
After a scan earlier in the year that Federer said was "not what I was hoping for", he added: "Very quickly we realised this was it.
"Then the question becomes 'How do you announce and when do you announce?' This is when it becomes reality. It was OK but stressful."
The 41-year-old had been spending the last few weeks preparing his retirement statement, and said that part of the process almost felt like "rehab".
"It's been an emotional few weeks to go through those words to try to get them right, that they reflect how I'm feeling and thanking all the people who have helped along the way," he said.
"I always pushed my retirement thoughts away. I said, the more I think about it, the more I'm already halfway retired and this is not the way to go to work, you know, for me as a tennis player, so we'll deal with it when it comes. And it did. And I dealt with it.
"I think writing those words was, for me parts, partially also like rehab, like going myself through all those words, feeling them."
Federer has spent 750 weeks in the top 10 of the men's singles rankings, the highest tally for a male player since they were first published in 1973.
The Swiss maestro has also won more men's singles main draw matches in grand slam tournaments than any other player in the Open Era (369).
"I don't think anybody grows up and thinks they're gonna win this much," he added. "You know, you're happy with winning a Wimbledon title, which is already crazy, or becoming number one, being the best.
"But then you don't think how many weeks, this is only the media and the fans talking about breaking records.
"Before it was just, I hope to be on tour one day. Just to make it into the top 100 is a huge deal. Coming from a small country, we don't have a base of so many players.
"I totally overachieved in my mind. It's been an absolute dream that I've had for so long. And I know that, and that's why I'm totally happy to step away as well."
Federer also praised the "incredible storytelling" in the game, and reminisced about the period of dominance after his emergence was followed by Rafael Nadal, Novak Djokovic and Andy Murray through the 2000s.
"When I came up, we didn't expect it either," he said. "We were more on a bit of a downslope after [Pete] Sampras retired. What's gonna come next, right? Well, here I came, and then came Rafa. And then there was Novak, and then Andy, all together.
"All of a sudden, there was this beautiful mix, we're all winning for 10 plus years, all the same tournaments, almost nobody else could win anything else. It was like a lock on the big tournaments.
"So I think, also for the fans, it's been a joy to watch, and I'm sure some fans will be sad I'm leaving, of course, but then again, there will always be wonderful new people.
"I think our tour allows for incredible storytelling so that's why I know that the game is very safe, and I'm sure it will see incredible new superstars."