You seem to be going through a tough time. I can appreciate your concern. Though it may seem like an endless struggle but nothing is permanent in life including loneliness. If you allow yourself, you could focus on your abilities, strengths and capabilities. It'll make you feel more comfortable and confident in yourself. It'll become easier to make friends then.
Next Steps
Since you think of killing yourself, I strongly recommend you to go to the nearest hospital emergency department and see a psychiatrist there.