It’s a common, arguably unavoidable situation: a friend’s career or personal life is advancing while you’re stuck in what feels like an endless loop of 9 to 5 roadblocks and relationship dead-ends. While it’s easy — and normal! — to grow jealous, you can harness that green-eyed monster to propel you toward your elusive goal.

“If you and your friend are doing very similar things, then your friend’s success could be a motivating factor,” said Dr. Venus Mahmoodi, a psychologist. The key is to realize you’re jealous, be happy for your friend, then “sit down and think about the things you like about your life and the things you could change.” A 2006 study published in the Academy of Management Journal found that the juxtaposing feelings of happiness and jealousy can help you better organize your life and fuel your creativity.

If your friend is on a different path but inciting envy nonetheless, those feelings of resentment can still work to your advantage.

“You need to ask yourself if being similar to your friend is the best route,” Dr. Mahmoodi said. “Or is it possible to find your own way and become successful in what you’re doing.” Your jealousy can then help you get over any anxieties you have over making a necessary change, or help you better manage your expectations and set realistic, personalized goals.

So the next time a friend’s promotion or engagement sends you down a jealous rabbit hole of self-loathing, use those feelings as a blueprint for your next success.