“Never give up.” “Persistence alone is omnipotent.” “When the going gets tough… ” and so on and so on. Our culture is awash in historical reminders to keep our “nose to the grindstone” until the job gets done. We’ve gotten good at the hustle. But the truth is that our culture doesn’t know when to quit.

What if the best decision is to give up? In his book, The Dip: A Little Book That Teaches You When to Quit, Seth Godin reminds us of the strategies that can help us stop working in a dead-end job or project. There are times when it’s best to cut your losses.

The business world understands how the law of diminishing returns works; at some point additional investments of time, money, and resources are not justified by the return. The best strategy in many cases is simply to stop.

But how will you know when to quit?  The answer is to focus on two costs, and ignore a third.

Opportunity Costs

In The Dip, Godin suggests it is time for “strategic quitting” when the opportunity costs are greater than the benefits of continuing on your current path. An opportunity cost is a big deal. But what is it?

An opportunity cost is the value of what you’d lose by not pursuing a better alternative. As I shared in my  TED talk, I decided to quit my job as President of Global Services at AT&T when it became clear that the benefit of staying wasn’t as high as the benefit of doing something else. The result of leaving in fact became the opportunity to run an internet startup that gave me a very different set of skills and experience that are critical to my current role today.

Figuring out what you could do at any point isn’t easy, but it’s crucial.

Personal Costs

Sometimes, we wrap too much of our own ego into a project to be able to step back and say with conviction, “It’s time to quit.” But, according to research from Northwestern University cited in a recent New York Times article: “When we discard unrealistic goals and switch to alternate goals we’re happier, physically healthier, and less stressed.”

That means separating failure from your sense of self-worth and viewing it as a needed stepping stone to success. Such a perspective can help you calculate personal costs you’ve already invested into a project.

Sunk Costs

While opportunity and personal costs are often difficult to quantify, it’s a third set of costs – sunk costs – that are the easiest to quantify and, as a result, often become the biggest problems.

As people get overly invested in the decisions they’ve made in the past, sunk costs from the past loom larger than they should as we look forward. The best advice I can offer regarding sunk costs is, ignore them.

Ralph Waldo Emerson wrote, “A foolish consistency is the hobgoblin of little minds.” Translation: Know when to cut your losses and go build something better.