We're often harder on ourselves than we are on other people, especially when it comes to failures. Treat yourself with the same compassion you would a friend to make working through hard times easier.
Image from taylorbri
If a friend told you about the same problem you're dealing with, you'd show them compassion and help them figure out what to do while calming them down. That's not our first instinct when we fail ourselves in the same way.
Zen Habits has a great little post on how to show yourself better self-compassion, and it's worth a read at the link below. But the main takeaway is this: if you'd do it for a friend, there's no reason not to treat yourself the same way.
A Simple, Powerful Self-Compassion Method [Zen Habits]