Sometimes when someone says to you, "You're selfish," what they're really saying is, "You're not sacrificing yourself for me."
There are two kinds of selfish. You're probably family with the negative one, where a person literally only thinks of enriching themselves.
But there is a good selfish too, which is, "I don't harm myself by thinking and acting only for others. I will also give myself compassion and communicate my boundaries." Healthy and functional people care for themselves before other people.