
The self-serving bias is the tendency to attribute successes to internal factors (your skill, effort, talent) and failures to external factors (bad luck, other people, circumstances).
The bias serves a psychological function: it protects self-esteem and maintains motivation. A complete absence of self-serving bias is actually associated with depression.
After a failure, ask: What is the one thing I could have done differently that would have changed the outcome? Anchor on your own agency, even partially.
Reference: