Some say that we should only think of others and others who say we should only think of ourselves.
Both of these are true.
To love ourselves we need to be selfish.
To love others we need to be unselfish.
If we are on a plane that is crashing we look after ourselves first, but as soon as our immediate needs are met we start looking out for others.
This follows the classic Ying and Yang where Ying takes over there is a dot of the Yang at the center that slowly takes over until there is a dot of Ying is the center and so on and so on.
Life is always balancing opposing forces, there is never a perfect equilibrium.