I too really struggle when I cannot sleep. For me I cannot sleep because my anxiety levels are so high. I know how depressing it can be being wide awake at night and the feelings of helplessness.
I can understand why the even thought of sleep might make you panic. For me the thought of no sleep makes me panic as I have had very poor mental health after a few days of no sleep. The brain started to play tricks on me and I became very anxious. The best thing I found when I struggle with sleep is to try and relax. Easier said than done! There's some good you tube videos on relaxation, meditation ect which I found helped distract my anxious mind. I also got a prescription of zolpidem (I'm allergic to zopiclone) to try and make myself fall asleep again. I set a goal to get ready for bed come 10pm. I am still doing this and am finding that the days I "prepare" to go to sleep with unwinding for the day and relaxing for bed are the days I am able to get off to sleep easier. The days I just go to bed without winding down I find are the days I'm lying awake until 3am worrying and feeling very awake. Hope some of these tips that have helped me helps you :)