The science on self-compassion is clear - it is more important to teach our kids how to self-sooth and cut themselves a break when they fail to meet their own expectations or that of the outside world, than almost anything else. If the little voice in their little heads constantly says "that wasn't good enough" and "I should have done much better" as opposed to "it's awesome I even tried that!" or "oh well, win some, lose some, I'm great anyway"... the trouble that starts to brew will loom large into adulthood.
As parents and educators, we spend so much time focusing on building self-esteem in kids (so they will get out there and not be afraid to try things in the first place), that we forget the piece around self-care and letting themselves off the hook when their efforts don't yield the results they want, or worse, when society tells them unequivocally that they've not measured up to set standards. When kids learn how to be kind to themselves, this ups their resilience to challenging/traumatic events, protects against stress and improves relationships all around. Developing self-compassion also increases their motivation to persist in a task post failure, and most interestingly, enhances a child's ability to show and feel compassion for others.
One way to put it to kids is to externalize the event and then explain that they can try to show themselves the same kindness and understanding as they would a friend in the exact same situation (i.e.: they can practice being their own Bestie!) > "Ok - so you failed that piano exam after practicing for months and months.... and that sucks. But maybe you're being extra hard on yourself? What would you say to your best friend if the exact same thing happened to her? Would you tell her to stay in her room and not go out to play or have any ice-cream because she failed? Would you tell her to speak very meanly to herself because she doesn't deserve any kindness right now? Or would you tell her something different?".
Give your kids a gander at Kermit & Don Music in this classic Sesame Street skit from yesteryear. Is Don Music being waaaaaaay too hard on himself? What kinds of things is he saying about himself that are actually getting in the way of writing the hit song he desires? And what does Kermit do to help him be his own Bestie?