The Swiss legend will retire from the sport after competing in this weekend's Laver Cup and revealed that persistent knee injuries over the past few years had taken their toll.
Federer, who has not played competitively since Wimbledon 2021, told BBC Breakfast: "The last three years have been tough to say the least.
"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."
The 20-time Grand Slam winner confirmed that he would retire from tennis in social media post last week and felt a sense of freedom after making the announcement public.
He said: "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.
"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 also paid tribute to the late Queen Elizabeth and recalled meeting her at Wimbledon when she visited in 2010.
He said: "I had the chance to eat lunch with her at Wimbledon when she came back finally to Wimbledon, after giving the trophy to Virginia Wade [in 1977].
"Everybody at the tennis was so happy she came and I was lucky enough to meet her. I will remember that forever."