It may sound generic, but treat yourself the way you would treat others.
If a close friend or family member came to you in a time of struggling, would you be angry with them, say they deserve it, and allow them to suffer?
Apply your answer to yourself.
If you are struggling, be kind with yourself. You do not deserve the hardships you go through. You are not incompetent. You are not weak. You are human.