Former Vice President Joe Biden is one of six presidential candidates taking part in a Democratic debate Tuesday, January 14, 2020, at 9 p.m. ET on CNN. The views expressed are his own. View more opinion articles on CNN.

(CNN) President Donald Trump's erratic actions have brought us to the brink of conflict with Iran -- and another war in the Middle East is the last thing we need. I'm thankful no one -- either American or Iraqi -- was killed in the Iranian missile strike . Both Trump and Iran's leaders should take the opportunity to de-escalate and take active steps to avert further conflict.

But make no mistake, the seeds of this crisis were planted by Trump himself on May 8, 2018 -- the day he tore up the Iran nuclear deal against the advice of his own top national security advisers , turned his back on our closest European allies and decided it was more important to him to destroy progress made by the Obama-Biden administration than build on it to create a better and safer world.

The Iran deal verifiably cut off every one of Iran's pathways to a nuclear weapon. International inspectors repeatedly confirmed Iran's compliance, as did our intelligence agencies . One of the greatest threats to stability in the region and global security -- a nuclear-armed Iran -- was greatly reduced.

When the Iran deal was in force, we did not have the dangerous cycle of tit-for-tat provocation and response with Iran that we have watched unfold in the Middle East over the past year, and there was a united front of allies and partners to address Iran's destabilizing actions throughout the region. The deal was not only accomplishing the critical mission it was designed for -- it was creating an environment where diplomacy was possible.

In tearing up the deal and re-imposing sanctions designed to exert "maximum pressure" on the regime, Trump claimed we would deter Iranian aggression and return Iran to the negotiating table to secure a much-promised "better deal." In fact, exactly the opposite happened: No "better deal" materialized and Iran became more aggressive , not less.

All of this was utterly predictable. Yet the Trump administration had no strategy to prevent, mitigate or deter Iranian provocations -- or stop the ever more dangerous cycle of action and reaction that led us to this moment.

Of course, Iran would seek to demonstrate that it could take actions to make life more difficult for us, as well -- beginning again to enrich uranium beyond the limits allowed under the Iran deal, allegedly attacking oil tankers in the Strait of Hormuz, shooting down an unmanned US surveillance drone.

Ultimately, Iranian-backed militia in Iraq restarted rocket attacks against our bases, and one of those attacks, against our base in Kirkuk , killed a US citizen and wounded others. It was a tragic loss of life, and an act condemned by all Americans.

In response, Trump bombed five sites in Iraq and Syria tied to the militia group, killing at least 25. Then, Iraqi protesters, organized by Iranian-backed militia, assaulted the US embassy in Baghdad and breached the outer wall. No injuries were reported, but Trump was embarrassed by the images of a burned-out reception area.

He ordered a drone strike to kill Qasem Soleimani -- perhaps the second most important official in Iran -- and rushed thousands more troops to the region to deal with the fallout. Iran retaliated by firing a barrage of missiles at two Iraqi bases that host US and coalition forces.

Action and reaction. Provocation and response.

I have no illusions about Soleimani or the Iranian regime. The regime has long sponsored terrorism and threatened our interests, and Soleimani was an architect of those efforts. Iran continues to detain American citizens. The regime has ruthlessly killed hundreds of protesters, and they should be held accountable for their actions.

But there is a smart way to counter them -- and a self-defeating way. Trump's approach is demonstrably the latter. Already, we are seeing the fallout.

Our embassies and people are less safe. More than 18,000 additional troops have been deployed to the Middle East in the past year. Worsening relations with NATO allies under Trump make it harder to accomplish any of our vital interests in the region, including Trump's request for our allies to carry more of the burden in the Middle East, while Russia and China are quietly reveling in the prospect that the United States may once more be bogged down in another major conflict in the Middle East, leaving them room to pursue their own agendas.

Yet, instead of offering the country reassurance and a clear path forward in his public statements, Trump is trying to mislead the country about the Obama-Biden record and blame President Barack Obama for the consequences of his own failed policies.

Trump has no strategy here. No endgame. The only way out of this crisis is through diplomacy -- clear-eyed, hard-nosed diplomacy grounded in strategy, that's not about one-off decisions or one-upmanship. We need diplomacy that is designed to de-escalate the crisis, protect our people and secure our regional interests -- including our counter-ISIS campaign.

The best way to start, of course, would be for Trump to rejoin the Iran deal and build on it -- if Iran also moves back into compliance with its obligations -- re-establishing international consensus about how to confront the threats from Iran.

Get our free weekly newsletter Sign up for CNN Opinion's new newsletter. Join us on Twitter and Facebook

No one wants war. But it's going to take hard work to make sure we don't end up there by accident.

That's what we owe to those brave men and women who step forward to wear the uniform of these United States, to those who dedicate their lives to diplomatic service and the intelligence community, to those who choose to join the Peace Corps or to work in development, and to those who represent the best of our country all around the world -- who are, today, doing so at greater risk because of the actions of our President.