Have you ever felt like life would be better if you had taken a different path? If only you had pursued that job, ended that relationship sooner or moved to a new city, everything would be just perfect.

Nonsense, of course. But it’s human nature to linger on those feelings of regret. We tend to look back and think that missed opportunities — real or imagined — could have set us on a different, possibly more rewarding path. Left unchecked, these emotions can become overwhelming sources of stress and anxiety.

But even painful emotions like regret can be powerful sources of inspiration. Whether you carry minor regrets that speak to your perfectionism, or you continuously cringe over more serious, “If only I …” thoughts, it’s possible to use regret as a lever to help you move ahead, rather than letting it weigh you down.

And there are good reasons for doing so. Researchers have found that obsessing over regrets has a negative impact on mood and sleep, it can increase impulsivity, and it be a risk factor for binge eating and misusing alcohol.

As a clinical psychologist, one of my most important tasks in helping people lead healthy, happy and meaningful lives is to teach them evidence-based strategies to manage their emotions. That includes how to use regrets to motivate them. I’ve found that even when people feel stuck in endless what ifs, it’s possible to recalibrate. Here’s how.