You spend a lot more time with yourself than anyone else. That gives you more chances to find flaws. If you find yourself wrestling with too much self-doubt, try phrasing your internal thoughts in the third person.
As productivity blog 99u points out, thinking of yourself in the third-person can help take the edge off some of your worst self-criticisms. You're used to saying things like "I screwed up", but you'd probably be a little less harsh to someone else. You might also offer advice or encouragement to someone else on how they could do better, rather than relentlessly beating them over the head with their failures. You deserve that same understanding:
When you get out of "me," "myself," and "I," you mentally gain distance from yourself and get out of your own head. Much like you can gain perspective on a piece of art by stepping back a few feet, you can gain added insight on your thought process by putting some mental distance between your present mindset and your typical nervous, anxious self. In other words, quieting the harsher inner critic gives you some much-needed space to think, and thus, perspective.
No matter how much you think you screwed up, you probably deserve a little more credit than you give yourself. Circumventing that instinct by talking about yourself in the third person can give you a glimpse into how you might treat the situation if it were someone else. That's not to say you'd never criticise yourself in the third-person. Sometimes, complaints are valid. However, you might feel less inclined to go overboard with it if you're thinking of yourself from an outside perspective.