You can talk to yourself, listen to yourself, and have empathy for yourself in the same way that you do these things in a loving relationship with someone else.
It's more obvious in a relationship with another person. They are a separate person from you, so it's more clear to hear their words and see their body language. When you're talking to them, you can watch their facial expressions as they explain their feelings. You can also assess how they react to your responses.
With yourself, it's not so obvious. Unless you're looking in a mirror, you can't see your body language. You might be able to hear your own thoughts, but they're not always fully formed, unless you write them down or speak them aloud.
We tend to think there's only one voice in our heads, but there can be two voices. There can be the voice that says, "I need this." And the voice that replies, "I will do that for you." The voice that says, "I need to be heard." And the voice that replies, "I will listen."
Your consciousness can ask your self, “How are you feeling?” And you can answer your consciousness, “I am feeling happy or sad or afraid or excited.” Then you can respond with empathy, “Ah, yes, I see you are feeling sad. That must be tough.” Or you can respond with action, “Okay, so you are sad. Let’s do something to not be sad anymore. Let’s do something that makes you happy.”
In this way, you can have a compassionate dialogue with yourself. You can understand where you're at emotionally and then choose to either hold space for where you're at or commit to the action necessary to get yourself into a more desirable emotional state.
Self-talk is part of self-love, in the same way that communication is important in any loving relationship.
Really good stuff to think about, especially for someone like me who has terrible self-talk