When we fail at something important to us, whether in relationships, at school, or at work, it can be very painful. These experiences can threaten the very core of who we think we are and who we want to be.

To cope with failure, we often turn to self-protective strategies. We rationalize what happened so that it places us in a more positive light, we blame other people, and we discount the importance of the event.

These strategies may make us feel better about ourselves in the short term, but they are less likely to help us improve or avoid repeating our mistakes in the future. Research shows that people who have an overly inflated view of their performance on an academic task show decrements in subsequent motivation and performance, compared to people who view themselves more realistically. It makes sense: if you already think you’re great, it may feel like there’s no need to put the effort into improving yourself.

Taking an honest look at ourselves is, of course, easier said than done. Confronting our inner demons can be overwhelming and lead to feelings of hopelessness and despair. Determined to take responsibility, we may get carried away, blaming ourselves for far more than our share and beating ourselves up emotionally.

Although many people believe that being hard on themselves will make them better people, research does not support this belief: Self-criticism has been shown to increase procrastination and rumination and impede goal progress. If you already feel worthless and incompetent, you may feel like there’s no point in even trying to do better next time.

Whether your M.O. is to build yourself up or put yourself down, it’s all about self-judgment. The focus is on, am I good person or a bad person? It’s easy to lose sight of questions that are more likely to get us somewhere, like how did this happen, and how can I avoid letting it happen again? What does it take to get out of the trap of self-judgment? Research from the field of social psychology offers some useful perspectives.

1. Criticize specific, changeable behaviors, not global, unchangeable attributes.

Research on explanatory style shows that people who blame negative events on all-encompassing, permanent aspects of themselves (e.g., “I’m just not an intelligent person”) are more likely to become depressed and suffer from health problems. Constructive self-criticism, by contrast, involves a more optimistic explanatory style, with a focus on specific and modifiable areas in need of improvement (e.g., “I stayed up too late watching TV when I could have been studying; next time I could set a TV limit for myself”).

2. Criticize external circumstances, but then try to change them.

Even in situations where we are obviously to blame, there may be situational factors that push us in one direction or another. For example, you stayed up late watching TV, but that’s partly because your roommates were also watching TV and it was hard to concentrate on your work. Rather than use this as an excuse, however, you could use it as leverage: When you have an exam the next day, you now know that studying at home may not be a good idea. One misconception about social psychology is that it focuses so much on external influences on the self that it denies individual responsibility. But awareness of the power of situational factors like peer pressure can actually help us make better decisions. If we believe we’re invulnerable to external pressures, we are more likely to be blindsided by them.

3. Shift your focus from yourself to others.

Instead of getting caught up in self-judgment, whether positive or negative, it can be helpful to consider how your actions affect other people. This broader focus can help reorient your attention to what matters most to you—the people you’re trying to help through your work, the relationship you want to nurture—and encourage you to make amends that benefit others. Research suggests that people who pursue compassionate goals rather than self-image goals have less conflict in their relationships, receive more support, and experience less loneliness. When we’re focused on protecting our own self-esteem, other people may represent competition or threats, and we may fail to recognize their needs.

4. Practice self-compassionate self-criticism.

Especially for people who are prone to shame, self-compassion can be exactly what is needed to make self-criticism bearable. Self-compassion is like a parachute that allows you to glide safely down into the parts of yourself you’re afraid to look at. It won’t let you get off easy, but it also won’t drop you down into the depths of despair. Self-compassion means saying, yes, I messed up, but this doesn’t make me a horrible person. This makes me a person who has strengths and weaknesses and room to improve. In this atmosphere of warmth, taking a closer look at those weaknesses is not as scary.