I can speak about this from the perspective of being raised in a Catholic household, and I don't want to make assumptions about other people's religions, even the ones I know a lot about but haven't experienced in the same way, but it's something I understand is an active philosophy in many religions.
There's this heavenly ledger, right? If your good deeds outweigh your bad ones, you get eternal salvation. Or, you know, you might have committed a bad deed so irredeemable that you will get punished for the rest of eternity no matter what. But mostly, you have to strive to be good, and your good deeds measure the worth of your soul.
We get rewarded for how good we are. We get punished for how bad we are.
But I've got to say, outside of nursery school, that's pretty much a big bag of BS.
The good things that happen in a life are not rewards for being a good person, or a worthy person by some other measure. The bad things that happen in life are not punishments.
Good things happen. Bad things happen. There isn't even a divine balance. Good things don't happen in equal proportion to bad.
So those things you don't have in your life: success, money, love, family, a pony, a freezer full of ice cream...that's not punishment, not for anything you've failed to do in this life, not for anything you've failed to do in a past life.
Sometimes kindness pays off. Sometimes generosity pays off. Sometimes love pays off. Sometimes hard work, persistence, practice, skill, bravery, defiance-- name a quality, and sometimes it pays off. But sometimes it doesn't. Sometimes it never does. And that does not mean there is something wrong with you. It just means your timing was bad, or your efforts were misdirected, or someone else got there first, or or or or.
Sometimes you fail because you've made a mistake. But not always. Sometimes you just fail. It doesn't mean you did badly, and it doesn't mean you're a bad person.
Sometimes you succeed because you worked your butt off and pushed yourself to be the best you can be. But not always. Sometimes you just succeed. It doesn't mean you did well, and it doesn't mean you're a good person.
(Although I say this with the caveat that I strongly believe most people, the vast majority of most people, are good people. The point is that success and goodness are not connected.)
Sometimes you succeed in spite of making a big mistake. Sometimes you fail in spite of doing everything perfectly.
And that's okay. It's, well, not okay okay, because it sucks when you repeatedly stumble when trying to achieve something you sorely want, and it's not always the best lesson to succeed in spite of laziness or lack of ethics, but it's okay because there is no heavenly ledger. There's no value judgment being projected on you, no cosmic force deciding that you can't have nice things because of that one time you pulled your sister's hair as a child.
This isn't to say that nothing is your fault. Sometimes you fail because you did something terribly wrong. You lost a friend because you hurt them. You were humiliated because you did something cruel. You didn't get a job because you were a jerk in the interview. Many, many things are direct consequences of our actions. And it's important to recognize that, too, and own our faults and our mistakes.
But don't own faults that aren't real, and don't own virtues that aren't real. Don't judge yourself harshly for things that are outside of your control, or so bogged down in so many variables that you just can't exercise the kind of control you might in another circumstance.
Just be good. Be good to each other. Be good to yourself. Do the best you can. Try your best. If you try your best and you fail, it doesn't mean your best wasn't good enough, or that you are not a good enough person. It means you failed. And that's sad, and it feels terrible, but that doesn't mean you are terrible. You know you're not terrible, because you were being good.
Or at least, you should know that. That is why I am telling you that right now.
Failure doesn't mean you're bad. Failure doesn't even mean you did badly. Not getting what you want doesn't mean you're not good enough.
You are good enough. That just doesn't mean there's a cosmic ledger tallying points in your favor. So, if you can, when you can, tally your own points. Tell yourself you're good enough.