This notion of feeling the pain in order to progress may be counterintuitive to those who believe in shaking off failures. But it’s actually motivating to learn how bad it feels to fail, according to study co-author Selin Malkoc, a marketing professor at The Ohio State University’s Fisher College of Business.

“All the advice tells you not to dwell on your mistakes, to not feel bad,” Malkoc said, according to a press release. “But we found the opposite. When faced with a failure, it is better to focus on one’s emotions — when people concentrate on how bad they feel and how they don’t want to experience these feelings again, they are more likely to try harder the next time.”

The Brief Newsletter

Sign up to receive the top stories you need to know right now. View Sample

Malkoc and two other researchers created three slightly varied study scenarios with nearly 100 people each to determine whether thinking about emotions of failure would change the response to new challenges.

In one scenario, 98 people were asked to find the lowest price online for a blender with specific characteristics, and were told they’d get a prize if they succeeded. The participants were then divided into two groups. One group was told to imagine failing and focus on their emotional response, and the other group was told to simply think about the details of their failure if they did not win. Afterward, all participants were told that they had failed — the actual lowest price was $3.27 less than whatever they submitted. When both groups were given a similar task again, the group that thought about their emotional response spent nearly 25% more time searching for the lowest price, compared to the other group.

The researchers also found that trying harder in the next task after thinking about emotions only occurred if the task was similar to the original failed task — people didn’t carry over the motivation into other types of exercises.

Malkoc advised people not to rationalize or shy away from their emotions after they make mistakes if they want to improve in the future.

“Emotional responses to failure can hurt,” she said in the release. “But if you focus on how bad you feel, you’re going to work harder to find a solution and make sure you don’t make the same mistake again.”