Forty years ago tomorrow — on July 4, 1976 — the largest armada in human history sailed into New York Harbor to celebrate the bicentennial of the United States of America. It was composed of 281 large vessels and small craft numbering in the thousands, all led by 17 magnificent “tall ships.”

President Gerald Ford sat aboard the USS Forrestal as the watercraft paraded before him along with more than half a million people.

And everywhere you looked, there was an American flag.

This was no small thing. It is almost unimaginable today, but in 1976 in many quarters, the flag had gone out of fashion except as an ironic fashion statement — something you sewed onto the rear pocket of your jeans, so that it was sat upon.

At my tony Manhattan private school, the bicentennial was celebrated with a day-long symposium titled “The American Dream: Has It Turned Into a Nightmare?”

The country was in a bad mood for good reason. Fifty-eight thousand Americans died in a war that ended with our countrymen scurrying onto helicopters from the roof of the Saigon embassy as the city fell to the Communists.

A president re-elected with 61 percent of the vote was compelled to resign because he and his people tried to bug the rival party’s headquarters.

Crime and inflation were on the rise everywhere. Arab potentates forced us into endless gas lines through an illegal embargo — an act of economic warfare — and we did nothing about it.

New York City, the world’s financial capital, went broke.

America felt like it was in decline because it was in decline. America felt bad about itself because the leading figures of its culture and its politics had lost confidence in the American experiment of its culture and its politics, and there was no one speaking up for it.

But our collective self-abasement in the 1970s did not reflect the deeper truth about the United States, even with the United States at a low ebb. On that day of the tall ships, we saw our country again as it was and is — the shining city on a hill, the last best hope of Earth.

On the cusp of Independence Day 2016, America remains what it has always been — the greatest and most far-reaching political experiment in human history. But as it enters its 241st year, there are few of us who really feel it.

The spirit of the left was captured over the past year by Bernie Sanders, who has almost nothing good to say about the current condition of the United States and claims the country is being destroyed by inequality.

The spirit of the anti-left has been captured by Donald Trump, who claims the country is no longer great and needs him to make it great again. The Republican Party has spent the years of Barack Obama’s presidency characterizing them as a cataclysm from which we may never recover.

In so doing, they followed the Democrats, who spent the Bush years characterizing them as a cataclysm from which we would never recover.

America remains what it has always been — the greatest and most far-reaching political experiment in human history.

Obama came into office belittling the idea of American “exceptionalism,” but now would wish people thought the country great because he’s led it for the past 7½ years.

Hillary Clinton wants people to think America was great when her husband was president, stopped being great when he stopped being president, got pretty great when her party took over again, but still needs her either to restore Clintonian greatness or reach new greatness or whatever you want just so long as she can be in the White House again.

The point here is that America has been getting it from all sides for the past 15 years. At different times and for different reasons, everyone has had an interest in painting things black.

And it’s an enormous wrong that’s being done here, an offense against the truth.

America is not great because of its leaders, who change, or because of the ideology they espouse, because that changes too as the views of the electorate change. America’s greatness has to do with the way it is organized. The central figure in the United States is the person. The central figure in the United States is you.

In the United States, according to the astounding document that was signed in Philadelphia 240 years ago tomorrow, it is “self evident” that “all men are created equal,” and that they have “unalienable rights” to “life, liberty and the pursuit of happiness.”

The adjective “unalienable” has tripped up schoolchildren forever, but it is the core word of the United States of America. It means that these are rights that cannot be taken away. They are part of what it means to be human. Efforts to take them away or abuse them are acts of tyranny.

It is impossible to grasp just how radical an idea this was in 1776 — and how radical an idea it is now, in 2016. Indeed, it was so radical in 1776 that it could not be fully implemented, with African-Americans remaining enslaved for another 87 years and women remaining without the franchise until 1920.

And it remains so radical now that we continue to fight political battles daily over efforts by government to abridge our unalienable rights at home, while abroad billions still live without rudimentary versions of the freedoms we enjoy.

The central figure in the United States is you.

Perhaps the most important freedom we enjoy is to practice our faiths. Outside the US, Christians are facing near-systematic elimination in Muslim lands while in China, the world’s largest country, believers of all kinds (Tibetan Buddhists especially) “continue to face arrests, fines, denials of justice, lengthy prison sentences and, in some cases, the closing or bulldozing of places of worship,” according to the US Commission on International Religious Freedom.

Because the United States is made up of human beings, and human beings are flawed, it is a flawed country and always has been. But due to another flaw in human nature — our strange desire to concentrate on the negative and avoid counting our blessings — American politics, culture and our education system have come to dwell on the dark side as much today as they did in 1976.

The history we teach our kids is a history of injustices and infamies — without the corresponding understanding that to a degree unknown anywhere in the world, America is self-correcting.

Indeed, self-correction is woven into its DNA. That is why the Constitution itself allows the amending of the constitution — to fix the document’s flaws and extend the nation’s blessings (and obligations) to those denied them at the time of the founding.

The preamble to the US Constitution explains its purpose is to “secure these blessings for ourselves and our posterity.” Since the Constitution is not fixed in amber and can be amended, the act of securing these blessings for ourselves and those who follow us has remained an obligation for every American from that day forward to this.

It’s not just the Constitution. We self-correct every year, through elections at the local, state and national levels that give us the power to change the country’s direction when that direction leads us so terribly astray. In 1976, four months after the tall ships, the country sought to purify its corrupted politics by electing Jimmy Carter, a former Georgia governor untainted by Washington scandals who promised, “I will never lie to you” as president.

When Carter proved to be alternately hapless and feckless in addressing the country’s financial and international ailments, we changed direction again four years later by electing Ronald Reagan, who vowed to attempt radically different cures for our ailments. Within a decade, the US economy had exploded and the Berlin Wall had fallen.

Our freedoms reside within us. That is the message of America. They are a part of us. Indeed, according to the philosophy that created this country, they reside within every living person on Earth.

The luckiest people on Earth are the people who are born Americans, or who become Americans.

But exercising our freedoms — now, that’s a different story. We have the precious gift in this country of exercising them pretty much at will. And that means too many of us have come to take them for granted.

We do so in part because we are human, and we are flawed. But we are also seduced into thinking our birthright as Americans is not what it truly is — the most precious gift any group of people has ever enjoyed. We are told that unless we get this, or get that, or get the other thing, the country is failing us.

We are seduced in this way by political and cultural leaders who seek either to harness our anger or generate it to use as a weapon against their rivals.

The luckiest people on Earth are the people who are born Americans, or who become Americans.

That’s what we all instinctively understood, 40 years ago, when we saw the masts of those tall ships sail into the harbor as they passed by Lady Liberty — her lamp lifted, as it has been since she was placed there in 1886, beside the golden door.