Barack Obama told Britain's Prince Harry, in an interview recorded in Toronto earlier this year and aired in the U.K. today, that people in government should be careful while using social media, although he didn't mention U.S. President Donald Trump directly.

"All of us in leadership have to find ways in which we can recreate a common space on the internet," the former president said to Harry, who was guest host for BBC Radio 4's Today program.

The show was recorded when Obama and Harry met up at the Invictus Games in Toronto in September. Both men said the interview was Obama's first since leaving the presidency in January.

Obama said the way people communicate via social media risks splintering society and leaders have to ensure the internet does not divide users with differing points of view. 

775046029BD00041_Invictus_G

Obama and Harry met up during the Invictus Games in Toronto on Sept. 29. (Chris Jackson/Invictus Games Foundation/Getty Images)

"One of the dangers of the internet is that people can have entirely different realities, they can be just cocooned in information that reinforces their current biases."

Obama said moving online communities offline helped people see that many issues were not as simple as they might seem in a social media feed.

"It's also, by the way, harder to be as obnoxious and cruel in person as people can be anonymously on the internet," he said.

'I miss the work'

He told the prince he felt "a sense of serenity" the day he left the White House, despite feeling much important work remained unfinished.

"I miss the work itself because it was fascinating," Obama said of his eight years in the Oval Office, citing his health-care reforms as one of his proudest achievements.

But he said it was "hugely liberating" to be able to set his own agenda in the morning and to have the time to talk with his wife, Michelle Obama, now that he is no longer president.

"The sense that there was a completion in that we had done the work in a way that preserved our integrity and left us whole, and that we hadn't fundamentally changed was a satisfying feeling. That was mixed with all the work that was still undone and concerns about how the country moves forward. But overall there was a serenity there more than I would have expected," he said.

Getting off what Harry called the "political treadmill" means he now he has the time to think and reflect, and there's a "lower intensity level" — though that means "you don't have the same adrenalin rush."

"My life had been so accelerated; everything felt like, and still feels to some extent, like it's moving in slow motion — not necessarily in a bad way."

harry guest host

Harry gives a thumbs-up from behind the glass wall of the radio studio. (BBC Radio 4 Today)

On the pressure, and importance, of wielding presidential power, Obama said: "I did not think i could do my job well, and I actually don't believe any leader can do their job well if they don't have the capacity to feel deeply about the people they are serving.

"If you don't understand that what you do every day has a profound impact on somebody else, then you shouldn't be there."

World is 'healthier, wealthier'

Harry asked about a subject they have both expressed an interest in: "how to give youth a voice, because they have great ideas and they are inevitably the ones who are going to inherit the mess that we leave behind."

Obama said he is "obsessed" with helping to train the next generation of leaders.

"How do I transmit whatever knowledge or experience that I've gained to others to help them become more effective and more powerful?"

Young people have "an energy and a spirit that can't be duplicated by somebody my age," which is 56. "There is a freshness to what young people perceive as possible. This generation coming up is the most sophisticated, the most tolerant in many ways, the most embracing of diversity, the most tech savvy, the most entrepreneurial, but they don't have much faith in existing institutions."

When asked to give people a reason to feel optimistic about the year ahead, Obama said: "If you had to choose a moment in human history in which you would want to be born ... you'd choose today, because the world is healthier, wealthier, better educated, more tolerant, more sophisticated and less violent than just about anytime in human history."

In a series of rapid-fire this-or-that questions, Obama chose Aretha Franklin over Tina Turner, Titanic over The Bodyguard, Suits (the Toronto-filmed show Harry's fiancée Meghan Markle appeared on) over The Good Wife — "obviously," the ex-president quipped — and the Queen over rock band Queen.

In a brief live segment at the end of the show, Harry said he did not know if Obama would be on the guest list for his wedding in May to Meghan as it had not yet been drawn up.

But he did say his  fiancée had enjoyed her first Christmas as a guest of his grandmother, Queen Elizabeth, at her country estate.

"She really enjoyed it, and the family loved having her there," said Harry.

With files from The Associated Press, Reuters