With dating and sex, there are so many worst-case scenarios.

The wedding that needs to be broken up. The passed-out date who must be carried somewhere. The minefield that one encounters while living with an ex.

Sadly, many of us have been there.

Luckily, we have David Borgenicht.

He has written “The Complete Worst-Case Scenario Survival Handbook: Dating & Sex” (Chronicle Books). With co-authors Joshua Piven and Ben H. Winters, Borgenicht presents about 400 pages of potential disasters — that bout of excessive gas on a date, for example — and suggests ways to overcome the problem. Or at least minimize the damage.

“Surviving any worst-case scenario comes down to not panicking, having a plan and ultimately being prepared,” he said. “And this applies to the realm of dating and sex.”

The book is the latest in the “Worst-Case Scenario” series, now numbering more than a dozen. Other topics include travel, parenting, weddings, college, paranormal, golf and survival.

The “Dating & Sex” version has topics ranging from innocent (how to treat a pimple) to more R-rated (how to bring up your fetish or kink with your partner). It’s organized by various sections, such as one on how to fend off a competitor for your date. That one is followed by sections on how to treat a black eye or a broken nose.

Borgenicht says the basic approach of the authors is to put themselves in the subject zone and start brainstorming all the things that could go wrong. Then they find experts to work things out.

“We have a scenario on how to escape from a bad date. We wanted ... tips on how to disguise yourself. We went to a master of disguise, a former CIA agent, Tony Mendez [who was portrayed by Ben Affleck in the 2012 film “Argo”]. So we interviewed him for tips on how to disguise yourself in the bathroom. The best thing to do, if you’re wearing sunglasses, take them off. If you’re not, put some on. Change your hair. Reverse your jacket. Change your walk.”

Among the most universally welcome advice is “How to Survive if You Forgot a Birthday.” The four key steps: Apologize, accept responsibility for your error, acknowledge your partner’s feelings and plan a special event to fix the mistake, you cad.

Perhaps less universal but certainly entertaining: How to have sex in a small place (including tips for a successful fling in an airplane lavatory).

Although the books in the series are sold in the humor section of stores, Borgenicht says they have changed people’s lives or the lives of loved ones.

“One woman was hiking with her daughter in California and remembered our advice on how to fend off a mountain lion,” he says. “We heard from someone in Seattle who was there during the earthquake and remembered our advice. A guy said he saved his girlfriend from a burning building by using our advice on how to break down a door.”

He added: “It’s kind of gratifying to know these books we wrote for entertainment maybe saved a few lives over the years.”

This one might save your love life.