In an often personal speech to the Cop26 summit in Glasgow, the former US president said there were times he felt doubtful humanity could get its act together before it was too late and “images of dystopia” crept into his mind.
But he warned that “cynicism is the recourse of cowards” and the world had to muster the will, passion and activism of citizens to push governments, companies and society to meet the challenge.
He took a swipe at China and Russia’s leaders for failing to attend the conference and said their national plans for climate action “reflect a dangerous lack of urgency and willingness to maintain the status quo”.
While advanced economies like the US and Europe needed to lead on climate, so did major emitters including China, India, Russia, Indonesia, South Africa and Brazil, he said.
“We can’t afford to have anyone on the sidelines,” he warned.
And in directing a large portion of his speech at young people, he said they were right to be angry and frustrated – and urged them to channel it, keep pushing and to gird themselves for a marathon not a sprint in solving the issue.
He told them to “vote like your life depends on it, because it does”, to put pressure on companies to take action and to educate their parents, relatives and teachers.
He added: “I recognise that many young people may be cynical about politics, but the cold, hard fact is we will not have more ambitious climate plans coming out of governments unless governments feel some pressure from voters.”
Mr Obama also said that while protests were necessary, there was also a need to listen to ordinary people who might be reluctant over climate action and help persuade them, instead of yelling at them or saying they were ignorant.
“It’s not enough to inconvenience them by blocking traffic in a protest – we actually have to listen to their objections and understand the reluctance of some ordinary people to see their countries move too fast on climate change,” he warned.
Quoting Shakespeare’s line from Othello asking “what wound did ever heal but by degrees”, Mr Obama said: “Our planet has been wounded by our actions.
“Those wounds won’t be healed today or tomorrow or the next, but they can be healed by degrees.
“If we start with the spirit that each of us can fight through the occasional frustration and dread, if we pledge to do our part and follow through on those commitments, I believe we can secure a better future. We have to.”
He also told delegates in a socially-distanced but full conference hall that America was back and the US is now “moving more boldly” after fours years of “active hostility” from the administration of Donald Trump.
Countries had made progress since the Paris climate accord was secured in the French capital in 2015, and more progress had been made in the past week in Glasgow, he said.
But he warned: “Collectively and individually we are still falling short. We have not done nearly enough to address this crisis.”
He told delegates that keeping the rise in global temperature to 1.5C, necessary to prevent the worst impacts of climate change, “will not be easy, it’s going to be hard”.
He said existing political institutions moved slowly, international cooperation was difficult and made harder by misinformation on social media, and getting people to work together on a global scale took time which the world did not have.
But he said: “The thing we have going for us is that humanity has done hard things before. I believe we can do hard things again.”
He said victories would be incomplete, and there would be setbacks, and imperfect compromises, but they would “move the ball down the field”.
Mr Obama is carrying out a series of events while in Glasgow, and earlier told a Cop26 meeting on island resilience that island nations are the “canaries in the coalmine” of climate change and are sending a message on the need for urgent action.
Mr Obama, who arrived in Glasgow on Sunday night, said larger nations should shoulder more of the burden of fixing the climate crisis and not enough has been done to combat the issue.
His comments came as ministers arrived for the political stage of the negotiations after leaders and countries signed up to a range of initiatives last week from tackling deforestation to curbing coal power and cutting methane to prevent dangerous global warming.
Earlier, Cop26 President Alok Sharma said countries must deliver on commitments made in the past week.
He said finding consensus on negotiations to make progress on climate action among almost 200 countries – needed for agreement under the UN system – was not going to be straightforward but progress last week demonstrated a “constructive spirit” among negotiators.