Skilled diplomacy is necessary to defuse the North Korean crisis, making it especially unfortunate that President Donald Trump took to Twitter again this week to deride, if not derail, Secretary of State Rex Tillerson's outreach efforts.

"I told Rex Tillerson, our wonderful Secretary of State, that he is wasting his time trying to negotiate with Little Rocket Man," Trump tweeted, using his childish nickname for North Korean leader Kim Jong Un. "Save your energy, Rex," Trump continued, "we'll do what has to be done!"

Actually, what the U.S. has to do is avoid triggering a missile barrage that could endanger all South Koreans. Instead, the Trump administration should focus on diplomacy that convinces America's allies and adversaries alike that this is a global crisis, not just bilateral belligerence that Trump has helped incite.

Building international support, however, may still necessitate direct talks with North Korea. To that end, Trump should have been encouraged that Tillerson told reporters, "We ask, 'would you like to talk?' We have lines of communications to Pyongyang — we're not in a dark situation, a blackout."

But the situation turned darker with Trump's tweeted hostility toward Kim — and by extension, Tillerson. It also prompted speculation about the secretary's job security in light of his strained relationship with Trump.

If Trump is trying to play bad cop to Tillerson's good cop, it's a bad strategy. A military miscalculation sparked by ill-chosen words would be a tragic mistake. Instead, a steady, rational response from the White House would focus global attention on the real source of the problem: Kim.

To be sure, even if rationality prevails and a dialogue proceeds, it will not be easy, especially regarding the ultimate goal of denuclearization. In fact, Trump's threats will likely exacerbate Kim's conviction that his survival depends on maintaining his arsenal. While the world won't want to accept the status quo in North Korea, it's likely that an ongoing strategy of containing and deterring Pyongyang will be required, with the long-term objective remaining nonproliferation on the Korean Peninsula.

And on a separate but related nuclear-security issue, Trump's reported decision to decertify the Iran nuclear-weapons deal — despite growing evidence that Tehran is living up to the agreement — may further incentivize Kim to continue his course of action.

"If you are attempting to do some kind of a freeze with North Korea, these two issues are interrelated," Christopher Bolan, professor at the Strategic Studies Institute of the U.S. Army War College, told an editorial writer. "You can't take action with one without the other party noticing what's going on, and I do think one of the strong aspects of the JCPOA [the Iran deal] is that it is a demonstration that can be reached and adhered to by both sides, and if North Korea sees that's not the case then it undermines any prospect we have of diplomacy to solve the issue with North Korea."

Trump's impulsiveness and social media threats undermine diplomacy, making it imperative that Tillerson and other rational actors in Washington continue to pursue strategies that will prevent war with North Korea.