When someone says, "You are being selfish," they've definitely intended to criticize you. What they mean is, you are paying too much attention to your own wants and needs instead of focusing on others first. Selfish behavior is often described as immoral. I've grown up being taught that you're considered a good person if you show you care about others more than yourself and if you put their needs before yours. This could be something small, like giving $1 to a homeless person rather than keeping your money for yourself, or sacrificing your free time to help someone with a task.
However, I believe a common misconception to the whole idea of being selfish is that it's not ALWAYS a bad thing. In a way, you can say there are two kinds of selfishness — it's only bad if what you do only benefits yourself at the very expense of other people. This type of selfishness involves taking advantage of other people, being openly greedy, only seeking self-gratification and exemplifying an immense lack of care for others.
But then there's the good selfish, the one where we, as humans, have a right to self-care; we need to take care of ourselves, nurture ourselves, and understand that we shouldn't forget to love ourselves. It's the type of selfishness where you need to love and be good to yourself first in order to know how to love and be good to others after.
Self-care is definitely about putting yourself first, and you should never feel guilty about doing so. This is you showing dedication to improving your lifestyle choices or trying to change something toxic about you. In a classic example of dealing with yourself vs. others, maybe a friend might ask you to go with them somewhere, say a party, but you'd much rather stay at home or do something else, something that would make you more comfortable. But you don't say no because you'd feel guilty, like a bad friend.
While the event is important to your friend, you should understand that you shouldn't be obligated to place yourself in a position you don't want to be in, for the sake of their benefit, every time. It's okay to make your own being a priority once in a while. It's okay to allow yourself to be happy rather than always the other person. By taking the time to be selfish, for your own sake and not at the expense of others, you are improving your mental health and overall inner happiness, which is something you shouldn't feel guilty about. And besides, if you do feel guilty, that, in itself, proves that you're not a bad or selfish person at all.