Wanting to be close to your friends or loved ones when you are passing away is not bad. I think it is a normal desire. As in all majour moments in our life, when we want and need others' company (e.g., marrying, giving birth to a child, being ill, etc.), the final stage of our life works the same. We are social beings.
When I read your message, it seems to me that it reveals that you need: a) company and the affection of your friends (that's why you don't want to die alone, but close to them); b) school has ended and you feel a vacuum, an emptiness.
Before attempting anything, my advice would be to try to meet your friends as much as you can not that it's the school holidays, and to try to find activities that would keep you occupied during the rest of Summer.
For you to reach out here, things must certainly be very hard and you must be going through lots of pain. But guessing that you are a young person, chances are in favour of your situation getting better with time. Give yourself a chance to figure things out, to find your inner strength, to rediscover your inherent worth, before resorting to any irreversible action.
If you have the time and will, please have a look at this e-book:
https://qprinstitute.com/pdfs/Forever_Decision.pdf
Kind regards