As America watches Donald Trump take the presidential oath on Friday, it’ll be worth taking a moment to think about what the future will show was a truly providential moment in our history: the presidency of Barack Obama.

It’s time to realize that the eight years of Obama were a gift that kept on giving, one that has cleared the field for Trump in ways we can’t see.

Why? Because in his eight years in office, Obama managed to expose the intellectual bankruptcy of liberalism. He revealed once and for all that it’s an ideology based on a flawed view of reality and of human nature, and that it has been a destructive force in our country going back to the New Deal, and going forward to ObamaCare.

Obama exposed the bankruptcy of the mainstream media and its bogus claims to be an objective information filter, when, in fact, outlets like CNN, NBC and the New York Times are mouthpieces for the Democratic Party.

He exposed the political bankruptcy of the so-called civil rights movement and groups like Black Lives Matter and showed that, instead of trying to improve the lives of African-Americans, they are geared to raise racial tensions for political gain.

He exposed the bankruptcy of Keynesian economics. After eight years of trying to use government borrowing and spending to grow the economy, Obama and his advisers have left us poorer, less competitive and with more adult Americans not working than at any time since the days of malaise in the 1970s.

Four years weren’t enough to expose these truths. It actually took eight years and Obama’s reelection in 2012 to fully reveal the lies, deceptions and fallacies on which his presidency was based.

Eight years for him to hollow out the Democratic Party at the national and state levels, so that Trump enters the White House with a Republican majority in both houses of Congress and with only four states out of 50 with Democratic governors and Democratic majority legislatures. The Democratic national leadership has been reduced to a politburo of septuagenarians and refugees from the SDS.

In the perpetual divide between liberalism and conservatism, Obama has shown us which is on the side of law and order, and which is not. He showed us side which cares about our veterans, and which does not.

He showed which supports our allies like Britain, Japan and Israel, and which does not.

He showed which side cares about national security, and which does not — and which feels free to let a traitor like Chelsea Manning go free.

He showed which is more concerned about protecting terrorists from Americans, including springing them from Gitmo, than protecting Americans from terrorists.

He showed the American people that federal agencies like the IRS, EPA and CIA have become politicized to a degree that makes them ineffective and even hostile to American interests.

He showed this nation and the world that appeasement of our foes, like China, Russia and Iran, doesn’t work, and that when America fails to lead, we are all put in peril — not only the people of Iraq and Syria and Europe, but the relatives of those who were massacred in a nightclub in Orlando, Fla.

Finally, after eight years in office, Barack Obama has left official Washington broken, exhausted and paralyzed by partisan rancor. Even Washington now recognizes it’s time for new blood and new ideas, and that whatever happens it’s bound to be better than what we’ve suffered since 2009.

All in all, it’s an opening for our new president like none since Ronald Reagan, or even going back to 1829 and the inauguration of Andrew Jackson.

And let’s face it. After eight years of Obama, Donald Trump has nowhere to go but up.