Don’t beat yourself up. We need to work on our selfishness, all of us, but this isn’t a reason to be down. We’re all broken, sinful people following one perfect person. While this doesn’t excuse our selfishness, it does let us know we’re not alone in the struggle. We all find this creeping its way up someplace in our life. Don’t let the discovery of this sin be a burden but let it be a motivator that God loves you, cares about you, and wants a better life for you where this has been rooted out and you life free from it.
Give yourself some grace, see the future ahead, and strive towards it.