Our first reaction to pain is to run away from it. Our brain is trying to tell us something's wrong, either physically like getting hurt, or mentally like feeling rejected. Instead of ignoring the pain or dwelling on it, use it as a signal to reflect on what's the cause behind the pain and what you can learn from the situation.
A simple example is when your back hurts, that can be a signal to fix your posture or work out your core muscles. If the signal continues, then you know it's time to go the doctor.
Another example is feeling rejected or inadequate. If you cling to the feeling, it can lead to rumination and more negative feelings like guilt and shame. If you ignore it, the underlying cause won't be fixed. Reflection leads to discovering whether this feeling of rejection came as a reaction of something we did or said, or we simply perceived the situation wrongly. Either conclusion is valuable to our well-being.
On the professional level, it is common to feel pain when a project goes wrong. Blaming or brushing it off won't produce any valuable knowledge about the experience. This is how postmortems became common practice in some companies.
"The most valuable habit I’ve acquired is using pain to trigger quality reflections." - Ray Dalio