This is a dilemma of teenage and youth, a child is not bothered by loneliness, he rarely cares if someone is around him, he is enough for his own entertainment. We start to look for peers, friends after reaching teenage, and in youth it usually reaches its deepest point.
In teens we are more eager to have friends we can talk with, share our life with but then we have family life and other things to fill up the void. In youth mostly we distance a little away from our family, most of us end up in hostel or in other towns to work and the interest becomes an urge. We start to look for relationships, mostly romantic. Some get it some don’t.
The tragedy is those who don’t become depressed, they start to think that there is something wrong with them, or others. They are missing something or others are mean. That can be or may not be true. Maybe the people you have ended up with are too different from you and don’t want to mingle with you but mostly they are just human beings, who have their own buddy group and are not quite keen to have another person unless s/he catches their fancy, which you don’t. That may not mean they are bad, if they are then you should be the one shunning them! If they are not then they are not the only people in the world. You can always find out some people who think like you and will love to spend time with you. If not a dozen then one or two! In the long run those one or two friends stick for longer span of time than a whole group.
If you can’t manage even one then maybe you are different from others? You are special? You just don’t fit into the common crowd? You may enjoy that uniqueness and start looking for other ways to entertain yourself! There are thousand and one ways in modern world. You can always build superficial friendship over internet if you are truly desperate for human companionship.
That will be better than forcing yourself to mingle with people who will snicker behind your back or will introduce you to things that may cause you, your future serious harm.
Sometimes, enjoying your own company is a very good idea.