Another thing I'd like to add to what
said is that you should avoid personalizing rejection.
People have a very strong tendency to blame themselves if another person isn't interested in being their friend. They ask themselves what they did wrong, think they must be a horrible person, etc. But the fact is, the vast majority of people are simply not compatible enough to be friends. You should realistically expect
most people to not want to be friends with you, even if they are very friendly. A friendly person who does not want to be friends is an acquaintance.
People only have time for a handful of real friends in their lives, and they tend to gravitate to those people they are most compatible with. Compatibility has next to nothing to do with how good a friend you would be in the abstract (ie. with your worth). You can be a perfectly lovely and pleasant person to be around and still be incompatible with almost everyone you meet. You can be a horrible, backstabbing SOB and still have friends. It depends on a lot of different factors.
So you should never take a person's rejection as evidence that you are an inherently unlikable or worthless person. Your desperation to make anyone who shows the least bit of interest in you a friend is something that can drive people away, but every person, without exception
, has traits that can drive people away (arrogance, paranoia, addictions, etc.). And you feel that way about yourself to a large degree because
you personalize rejection. In all likelihood, if you have few or no friends, it's because you have a strategy of avoidance that limits the number of people you come into contact with, and when you are with them, you're afraid to open up. And you likely have that strategy at least in part because you're convinced of your own unlikability.
If you rarely meet new people, the chances of you meeting someone compatible are very small. Getting emotionally attached and invested in people who don't reciprocate your feelings is something that tends to happen to people who have very few contacts. They invest every relationship with more emotional weight than most relationships can support, thus creating a cycle of rejection and disappointment.