What is the self-serving bias?
We claim credit for our successes (it was our skill) but blame our failures on outside factors (bad luck, other people, circumstances).
The mechanism is ego-protection: attributing wins to ourselves and losses to the world keeps our self-image intact and our confidence high. It's a comfortable, lopsided accounting where the books are always balanced in our favour.
Example: A student who aces an exam says "I'm clearly good at this." The same student who fails the next one says "the questions were unfair and that material was never taught" — the cause of the outcome conveniently flips depending on whether it flatters them.
Tip: It's the mirror image of the fundamental attribution error pointed at yourself — and a useful check is to explain a failure the way you'd explain someone else's.