A few key sentences from a Wall Street Journal piece by Gen. Jim Mattis, the former secretary of defense, serve as a not-so-veiled, but oh-so-important, warning to and about President Trump.

If Trump won’t listen, the rest of us should both listen and act responsibly to find a reasonable alternative to reelecting this president.

Mattis’ essay, an adapted excerpt from a forthcoming book, makes an impassioned case against unilateralism of the sort Trump practices.

“Nations with allies thrive, and those without them wither,” Mattis writes. “Alone, America cannot protect our people and our economy. At this time, we can see storm clouds gathering. … A leader must display strategic acumen that incorporates respect for those nations that have stood with us when trouble loomed. Returning to a strategic stance that includes the interests of as many nations as we can make common cause with, we can better deal with this imperfect world we occupy together. Absent this, we will occupy an increasingly lonely position, one that puts us at increasing risk.”

Contrast that with the abominable isolation of Trump at last weekend’s G-7 summit, where he unpopularly and wrongly carried water for Russian dictator Vladimir Putin, ignored other leaders’ pleas to back off his trade war with China, defended North Korea’s recent missile tests, and in general acted like the caricature of the “Ugly American” brought to quite unwelcome life.

Likewise, Mattis offered concerns about our civic culture: “Currently our own commons seems to be breaking apart. What concerns me most as a military man is not our external adversaries; it is our internal divisiveness. We are dividing into hostile tribes cheering against each other, fueled by emotion and a mutual disdain that jeopardizes our future, instead of rediscovering our common ground and finding solutions. ... We all know that we’re better than our current politics. Tribalism must not be allowed to destroy our [American constitutional] experiment.”

Obviously, Trump feeds this harmful tribalism, not by mistake but with relish.

What is most disturbing, though, is that Mattis is writing books and columns rather than still serving at the Pentagon. His essay included one brief nod as to why that happened.

“When my concrete solutions and strategic advice, especially keeping faith with our allies, no longer resonated, it was time to resign,” Mattis wrote.

This is a delicate way of putting it. The reality is that Mattis resigned because Trump announced, with virtually no consultation, that he would snatch defeat away from one of the most impressive victories in the history of the United States military by withdrawing the small but lethal contingent of American troops from Syria, just as the Islamic State was being wiped out.

Trump subsequently reconsidered after Mattis already had resigned, but Trump’s on-again/off-again commitment to the effort has left our Kurdish allies in the lurch.

While Trump likes to claim he eradicated ISIS, the truth is that ISIS is now reconstituting because Trump took the boot off the throat. Meanwhile, as the Kurds are overwhelmed with a crisis of 60,000 enraged jihadis/ISIS supporters (wives and children and other relatives of the fighters) penned up in porous “camps” in eastern Syria, the biggest victors in the rest of that country are the brutal dictator Bashar Assad and his backer, Putin.

Jim Mattis was one of the most effective generals and defense secretaries in U.S. history. For him to be writing instead of leading is a sign of an inept, unstable presidency.

Marines, Mattis wrote, “expect you to have done your homework, to have mastered your profession. Amateur performance is anathema.” Diplomatically and militarily, unfortunately, our current administration is dangerously amateurish.