They might be someone you haven't seen in a while or someone you have seen too much of and really don't care to be around them. But when a friend needs a friend (and you just so happen to be that friend) then be the friend. Meaning: don't put yourself first.
The art of greeting strangers with kindness is an art form for sure. It requires practice. Daily practice to make it a habit that sticks. The best place to get the practice you need is often right in front of your face. Showing compassion and kindness and patience with someone close to you, even if it's a friend who wants to suck everything you have out of you, doesn't listen to a word of advice they are asking for from you, or who have simply worn out their welcome with their selfish all-about-me drama, take the time to be with them. Treat them like you would treat someone you want to spend eternity with. This kind of practice makes greeting someone you don't know a little more easy and enjoyable.
A friend needs to talk, but you need to work. What do you do? Are you willing to stop and go for a hike or a walk around the block? Are you willing to stop what you are doing to have a cup of coffee and a good cry? Is your work more important than their emotional well-being? I don't know. There's one way to find out though. Practice kindness and see if the answer comes to you.
NOTE: By writing this I am forced to live up to it. So if any of you need me, I'll do my best to give you my full attention. That is, if you can find me.