Even when President Trump tries to do the right thing, he often ends up doing it the wrong way.

So here is some half-praise for the president: It is a good thing he is seeking to end America's war in Afghanistan. Withdrawing from that country after nearly two decades of combat comes with some moral complications, but it's unlikely America will ever find a way to "win" the war there. It is probably time to pull out.

But there is a wrong way to achieve peace, of course. And that way probably involves inviting the Taliban to Camp David on the anniversary of the 9/11 attacks. Which is precisely what Trump was prepared to do — until, he said over the weekend, Taliban attacks on American troops forced him to call the whole thing off.

Some of Trump's critics on the matter, such as Liz Cheney, probably won't be satisfied with any efforts at peace in Afghanistan. Some are reflexively anti-Trump. But a few — count me in this camp — just wish the president hadn't been so tone-deaf in his efforts. Bring the Taliban to America on 9/11? Really?

Herein lies one of the great dangers of the Trump administration: If he keeps making a hash out of his peace efforts, there is a possibility that peace itself — and not the president — will bear some of the blame in the eyes of future policymakers.

Trump is no dove — he has too much sympathy for murderous dictators and and a gleeful willingness to encourage and overlook war crimes. But he is also apparently much less inclined than most of the Washington establishment to throw the American military at the challenges confronting us around the globe. This would be a welcome development, except that Trump routinely tends to discredit the causes he advances. And this creates the terrible possibility that a more peaceful approach to the world — which America so desperately needs after its 21st-century blunders abroad — will be disregarded even before it has had a real chance to succeed.

Trump's relative aversion to hawkishness has been one of the few virtues of his presidency. His disregard for the norms and conventions of American policy is often irritating and harmful, but his willingness to negotiate with North Korea and the Taliban, while radical, is also quite refreshing. There are a few problems with his actual approach, though.

The first, of course, is that it is driven — like so much Trump policy — by the president's narcissism. Does anybody think he would be holding summits in the demilitarized zone if Kim Jong Un weren't so skilled at buttering him up? The same impulse that leads the president to hijack a week of headlines by editing hurricane forecasts with a Sharpie is the same one that drew him to the DMZ — and the same one, apparently, that prompted him to make the grand gesture of inviting the Taliban to Camp David. It should be obvious, however, that the president's ego is too fragile a foundation for America's foreign policy to stand on.

Temperament is one problem. Philosophy is another. A genuinely less-hawkish approach to world affairs would be concerned with building international friendships and institutions of the sort that the United States helped build after World War II. Instead, the president has dedicated his tenure to tearing down relationships with old allies and undermining the legitimacy of longstanding treaties and alliances. Institutions like the United Nations are admittedly imperfect, but they were created in the aftermath of two world wars that killed millions of people. Humankind is still bloodthirsty and occasionally genocidal, but we also seem to have slowed our deadly roll over the last 70 years. Trump, though, stubbornly refuses to learn the lessons from those cooperative efforts. He'd rather go it alone. Isolationism and dovishness are not the same thing.

The problems of Trump's temperament and ideology are compounded by the fact that he and his administration are just so damned clumsy at foreign affairs. For starters, if you want to build peace in North Korea and Afghanistan, you don't hire John Bolton as your national security adviser. And if you want Americans to rejoice at the end of the war, you are sensitive to the symbolism of meeting with your enemies on the 9/11 holiday. Furthermore, if you want to prevent misunderstandings, you don't conduct policy by tweet.

Barack Obama became president in 2008 in part because, after the failure in Iraq and the stagnation in Afghanistan, it seemed clear that post-Cold War hawkishness had failed, or at least reached its limits, as the lodestar of American foreign policy. Trump came to office sounding similar themes.

But memories are short. Trump has already done so much damage with his presidency. Let's hope he doesn't end up also discrediting the doves, too.

Want more essential commentary and analysis like this delivered straight to your inbox? Sign up for The Week's "Today's best articles" newsletter here.