What is a friend? Just as you say, anonymous people that you've never met are not your friends. You cannot call someone you don't know a friend. They don't exist since you don't even know they're there.
A friend is someone "you can trust to help you at any moment." That is true. There's no refuting that. However, despite being right, you don't know that you're wrong.
What is a friend? What does a friend do? Have you ever asked yourself this? Let's break it down to basic math using your own words.
A friend is someone who trusts.
A friend is someone who helps.
These two are components to a friend. You can't have them without the other. However, how do we connect these two components together?
You can help a stranger without knowing them.
You can trust a co-worker to turn off the lights after the night shift.
But, they're not a friend, right? Stranger and co-worker is not included in the "Friend" bundle. So, how does "stranger" and "co-worker" become "Friend?"
x + Trust + Help = Friend
The answer is simple. It's in your own words too:
"talking to you"
There are many cases of friendships developing over time over writing. Though the internet is a recent thing, "online talking" has been something that's been done for a very long time. Do you know what it is?
Letters. Writing and receiving letters. Faraway family writes them to you, loving you even though you don't see them often or you've never met them. Lovers send letters to each other frequently, especially during both World Wars where the death of your loved ones was as expected as breathing. There have even been cases of anonymous writers sending each other letters under hidden pen names, developing friendships over time despite never meeting in their entire lives.
You can trust friends to talk to you. To make you feel better when you're down, depressed, or whatever. They make you happy, they're always "there to help you."