This is known as "self-enhancement".
Self-enhancement is when people tend to rate themselves better than expected, trust they have a superior than normal likelihood of progress, and ascribe their victories to individual inspiration or capacity while reprimanding the circumstance for their missteps.
Self-enhancement is a kind of inspiration that attempts to influence individuals to like themselves and to keep up confidence. This thought process turns out to be particularly unmistakable in circumstances of risk, disappointment or hits to one's confidence. Self-improvement includes an inclination for positive over negative self-sees.