Former President Barack Obama has been interviewed by Prince Harry on BBC Radio 4.
Prince Harry, the fifth in line to the UK’s throne, is one of several prominent figures who are guest-editing Today program over Christmas period.
Barack Obama warned against the irresponsible use of social media and how such actions were distorting people’s understanding of complex issues, and spreading misinformation.
The former president expressed concern about a future where facts are discarded and people only read and listen to things that reinforce their own views.
He said: “One of the dangers of the internet is that people can have entirely different realities. They can be cocooned in information that reinforces their current biases.
“The question has to do with how do we harness this technology in a way that allows a multiplicity of voices, allows a diversity of views, but doesn’t lead to a Balkanization of society and allows ways of finding common ground.”
President Donald Trump is a prolific user of Twitter, but Barack Obama did not mention him by name.
Donald Trump has been accused of overusing Twitter and following only a narrow range of users, though he maintains it allows him to connect directly with the American people.
Barack Obama suggested face-to-face contact would help counteract extreme views.
He said: “Social media is a really powerful tool for people of common interests to convene and get to know each other and connect.
“But then it’s important for them to get offline, meet in a pub, meet at a place of worship, meet in a neighborhood and get to know each other.
“Because the truth is that on the internet, everything is simplified and when you meet people face-to-face it turns out they’re complicated.”
The former president added: “It’s hard, being in the public eye is unpleasant in a lot of ways. It is challenging in a lot of ways.
“Your loved ones are made vulnerable in ways that might not have been true 20 years ago or 30 years ago.
“So it is a sacrifice that I think everybody has to be at peace with when they decide to go into politics. But, ultimately, I think the rewards of bringing about positive change in this world make it worthwhile.”
Barack Obama pays tribute to the support of his family, especially his wife Michelle, describing how glad he is that she was “my partner throughout that whole process”.
He compared his time in office to being a relay runner: “If you ran hard, you did your best and you were able to pass that baton successfully and the world was a little better then you had done your job.”
He cited ObamaCare – ensuring more people can afford basic healthcare – as a major achievement.
“What an enormous blessing it is to say that 20 million Americans have health insurance that didn’t have it before.”
Prince Harry’s program focused on issues such as the armed forces, mental health, youth crime and climate change.