Although Buddhism teaches self-less-ness, self-care isn't excluded.
The easiest way to understand this is based on understanding that attaining nibbana, or awakening, doesn't equate vanishing into thin air. ‘Something’ still remains after one has abandoned selfishness, lust, aversion, ignorance: in Zen schools, this is called the ‘True Self.’ The Buddha could still be designated after his Awakening, he often called himself “the Tathāgata” but he also issued first-person statements (e.g. “I speak about an island”1 —Kappamāṇavapucchā, Sn 5.11) and explicitly used the ‘I’ pronoun (e.g. “Bhikkhus, I do not dispute with the world”2 —puppha sutta, SN 22.94).
After letting go of the fiction of the self, of the little stories and narratives we use to define ourselves and separate ourselves from others, what's left —an embodiment of Wisdom— might be called a True Self. And taking care of such a True Self (e.g. by avoiding the extremes of asceticism and of indulgence) for the benefit of all beings, makes some sense.
So, some notion of self-care isn't excluded from Buddhism.
Moreover, actually ‘realizing’ selflessness is associated with the end of the journey, so intermediate steps (along the path) might well rely on conventional ‘self’, ‘person’, etc. as expedient means. Hence the theory of kamma / karma is commonly explained in terms of ‘person’, not of phenomenologically atomic dhamma.
In fact, discerning selfishness from self-care is key in realizing selflessness! Selfishness is a form of blindness about long-term consequences; for some supposed “personal benefit”, one clings to wrong views justifying the worsening of the world… the very world one lives in! Selfishness is thereby akin to shooting oneself in the foot, hence hardly a truly beneficial strategy.
Craving leads to “… … … …