“Two things greater than all things are,” wrote Rudyard Kipling: “The first is Love and the second War.” Romance and conflict have always been intimately bound together. Love can provoke war, at least judging by accounts of the Trojan War in Greek mythology. Relationships may also deteriorate into something akin to a battlefield, as portrayed in the darkly comic 1980s divorce movie, The War of the Roses. Love and war are two extremes of human experience where the ends are sometimes thought to justify the means. An early 17th-century translation of Cervantes’s Don Quixote reads: “Love and warre are all one. … It is lawfull to use sleights and stratagems to … attaine the wished end”—a saying that evolved into the proverb, “All is fair in love and war.”

If love is a battlefield, then perhaps romantic relationships can offer important lessons for how to think about military conflict. After all, given America’s military travails over the last several decades in Vietnam, Iraq, and Afghanistan, the United States needs all the help it can get.

The first lesson from the world of dating and marriage is to look before you leap. If you’re considering a quick-fire wedding in Las Vegas, for example, it might be wise to first spend some time sitting in divorce courts watching hasty marriages unravel. It may also be useful to create a contingency plan if romance fails. In a New York Times article titled “Ready in Case the Other Shoe Should Drop,” one woman described how she kept a survival kit in storage in the event that her relationship ended and she had to move out of the place she shared with her boyfriend, complete with flannel sheets and kitchen utensils.

Similarly, before going to war, American officials should think seriously about what they will do if the campaign fails and the United States needs to get out of a quagmire. For one thing, working through the challenges of an exit strategy ahead of time may cause even the most hawkish leader to think twice about war. And it also means that officials are prepared for negative contingencies. Before the invasion of Iraq, for example, the George W. Bush administration brushed aside critics who pointed out the dangers of regime change. According to the Special Inspector General for Iraq Reconstruction, “when Iraq’s withering post-invasion reality superseded [official] expectations, there was no well-defined ‘Plan B’ as a fallback and no existing government structures or resources to support a quick response.” When the other shoe dropped, the U.S. government had no survival kit and was left to desperately improvise.

Another lesson is that bad is stronger than good. A core principle in psychology is “negativity bias,” where we weigh bad information more heavily than good information. In relationships, hurtful words do more damage than kind words do good. One key to a successful marriage, therefore, is to cut down on the bad behavior. In his book Why Marriages Succeed or Fail, John Gottman identified a magic ratio of 5:1: There must be five times as much positive interaction as negative interaction for a marriage to thrive.

Dealing with allies in wartime is a lot like marriage. Countries are thrown together in a common project despite varying interests and agendas. And the negativity bias means that leaders fixate on bad behavior from their allies—whether it’s corruption in Kabul or a U.S. air strike that accidentally kills Afghan civilians. Trust between allies takes a long time to build and an instant to destroy. The answer is to aim for the 5:1 ratio. A great many flowers (or dollars of military aid) are needed to compensate for a single slipup.

Love points to another principle: Become hard of hearing. When U.S. Supreme Court Justice Ruth Bader Ginsburg got married in 1954, her future mother-in-law advised her: “In every good marriage, it pays sometimes to be a little deaf.” Ginsburg said it was a useful rule on the Supreme Court as well.

When dealing with wartime allies, it can also be smart to pretend we didn’t hear. If a difficult partner like former Afghan President Hamid Karzai suggests the United States is colluding with the Taliban, it’s tempting to berate his lack of gratitude and then cut him loose. But it’s important to recognize the difference between a local ally who is shifting his allegiance away from the United States and someone who is simply blowing off steam and demonstrating he’s no U.S. puppet. In the latter case, the best answer is sometimes just to ignore the rhetoric.

Relationships also reveal the power of sunk costs, or past investments that can’t be recovered. Rationally, we should ignore sunk costs and focus on the future. But instead people tend to double down and invest more to justify their earlier sacrifice. A classic sunk cost is the time spent in a relationship. People will stay in failing or even abusive marriages as a way of rationalizing their earlier investment—essentially pouring good money after bad.

The same danger exists in wartime, when soldiers lost in battle constitute a powerful sunk cost that can motivate countries to make even greater sacrifice, further swelling the casualties. “From these honored dead,” said Abraham Lincoln at Gettysburg, “we take increased devotion to that cause for which they gave the last full measure of devotion.” These are beautiful words, but the logic is catastrophic in a war like Vietnam. Just as people in relationships should focus on the future, so leaders in wartime should prioritize the soldiers who are still alive.

Relationships are closest to warfare during the endgame. Indeed, getting out of a tough relationship can feel something like getting out of Iraq. Here, one lesson is the importance of final acts. Psychologists have found that people remember things based on how they end, for good or ill. (For a simple demonstration, consider how describing someone as “untrustworthy but wise” sounds so much better than saying “wise but untrustworthy.”) Therefore, people breaking up should strive to make the last rites of their relationship as civil as possible. In war, the parties also need an honorable exit. The closing moments will profoundly shape how people recall the entire campaign. When Americans think of the Vietnam War, for instance, they tend to see the last chaotic scenes with helicopters rescuing people from rooftops—the capstone of catastrophe.

The next challenge is handling the aftermath. Following a romantic breakup, friendship isn’t always feasible, but reconciliation is still a valuable goal. Oftentimes, there’s a kind of dance of amity, where one partner makes a gesture of friendship, perhaps expressing regret for past errors, contacts grow, and then relations gradually become more normal. In the wake of war, the United States can also try to reconcile with its former enemy. After all, many of America’s historical adversaries are now allies, including Britain, Germany, and Japan. Rapprochement involves its own diplomatic dance, where one side makes a peace offering, political and social contacts develop, and eventually the two countries write new and more positive narratives of their relationship.

When romance ends, it’s critical to learn the right lessons. We should avoid amnesia (trying to forget the whole thing) or trauma (recoiling from anything associated with the experience). Instead, we must confront the hard truths about what went wrong, and move on to a new and better relationship.

Similarly, after a difficult war, it’s dangerous to either forget about or obsess over the past. The truth is that failure is a gift. We learn by losing. Tough wars can help nations emerge stronger than before. It comes down to finding the right story to explain what happened. “All sorrows can be borne,” said the Danish author Isak Dinesen, “if you put them in a story or tell a story about them.”

In both love and war, we strive for unconditional triumph. But if that’s not possible, the goal should be peace with honor.