Democrats are distraught at the prospect of President Donald Trump filling a second Supreme Court seat after Justice Anthony Kennedy announced his retirement. They are also furious that the Court ruled in favor of the Trump administration on the “travel ban,” and barred public sector unions from collecting dues from non-members.

On the positive side, the party’s “progressive” wing celebrated the upset victory of Alexandria Ocasio-Cortez, 28, in the primary race for New York’s 14th congressional district.

These events, collectively, provided a long-overdue civics lesson to Democrats, who were too busy “fundamentally transforming” America during President Barack Obama’s long tenure to consider what was in the best interests of our constitutional democracy.

Lesson 1: Do not remove checks on the power of the majority just because it happens to suit your short-term interests.

Retired former Senate Majority Leader Harry Reid was proud to remove the filibuster in 2013 so that Democrats could push through Obama’s judicial nominees. Last year, Majority Leader Mitch McConnell (R-KY) followed Reid’s logic and removed it for Supreme Court nominees as well. Now Democrats are powerless to stop Trump from appointing Kennedy’s replacement.

That is a lesson Trump would do well to remember, as he urges the Senate to remove the filibuster for ordinary legislation. While Trump’s frustration is understandable, there is no doubt Democrats would abuse the power of the majority when they return to power.

Lesson 2: Do not make judicial appointments ideological inquisitions that overlook the qualifications of the applicants.

Democrats launched the judicial wars when President Ronald Reagan nominated Robert Bork to serve on the Supreme Court. Even after that, Republicans had tended to acquiesce to judicial nominations by Democratic presidents, on the principle that “elections have consequences.” But Democrats have remained belligerent, and their presidents have nominated judges who march in lockstep with the left.

The result: conservatives united behind Trump in 2016, despite deep divisions, to save the Supreme Court. Trump won, and went on to outsource the recruitment of judges to the conservative Federalist Society, setting the left back for decades.

Lesson 3: Live by the executive order, die by the executive order.

Rather than compromise with the opposition, Obama used his “pen-and-phone” strategy to exert — and exceed — presidential powers. Having celebrated Obama’s executive audacity, Democrats had little basis to oppose Trump’s travel ban — which, unlike many of Obama’s executive actions, was both legal and constitutional.

Lesson 4: When in power, forget about “fundamentally transforming” America and simply govern well instead.

Democrats might still be in power if Obama and then-Speaker Nancy Pelosi, who wants to reclaim the gavel this November, had not pushed Obamacare through Congress in 2010 — a Census year. They have not learned their lesson: by moving further and further to the left, Democrats risk motivating GOP voters to turn out to keep the democratic socialists of the so-called “Resistance” out of office.

Lesson 5: Leave the conspiracy theories aside and focus on the needs of voters in 2018 if you want to regain Congress.

Ocasio-Cortez has many radical ideas: abolishing Immigration and Customs Enforcement (ICE); free health care and college tuition for everyone; guaranteed federal jobs; and more. Her views will be a drag on the party as it tries to win seats in swing districts.

But one thing Ocasio-Cortez did right was to focus on the voters in her district, and the issues they care about, rather than wasting her energy complaining about Russian collusion. She still wants to impeach Trump, but at that is not her only agenda item.

Sadly, Democrats seem convinced that ordinary civics are inadequate to the task that faces them. Some mock the very idea of civility. And some call for the harassment of government officials. It may take the shock of a loss in 2018 for them to reconsider.

Joel B. Pollak is Senior Editor-at-Large at Breitbart News. He is a winner of the 2018 Robert Novak Journalism Alumni Fellowship. He is also the co-author of How Trump Won: The Inside Story of a Revolution, which is available from Regnery. Follow him on Twitter at @joelpollak.