A self-serving bias is the common habit of a person taking credit for positive events or outcomes, but blaming outside factors for negative events. This can be affected by age, culture, clinical diagnosis, and more. It tends to occur widely across populations.
For example, if I make a mistake, I might rationalize it by saying that it wasn't really my fault or that I was under a lot of stress at the time. On the other hand, if someone else makes the same mistake, I'm quick to point out what they did wrong and how they could have done better.