Time to employ a bit of bodily subterfuge.
Being stuck staring up at the ceiling in the middle of the night, unable to properly fall asleep, is just the absolute worst. Sometimes it doesn’t even happen for a good reason, like loud noises or a light in your eyes; a bad night’s sleep can just sneak up on you out of nowhere. One time, I had a sleepless night because I had the first few lines of a J-pop song stuck in my head, and now I have a minor fear response whenever I hear that song. But you need your sleep, so you’re gonna have to figure out how to knock yourself out, even if you gotta trick your body to do it.
First and foremost, try to identify what, if anything is keeping you awake. Is an errant lamppost shining through your blinds? Block the window with something. Is it too hot or cold? Adjust the thermostat or change your clothes and blanket. Is someone making a ruckus next door? Put some earplugs in. Is it too quiet? Put on some white noise. Though, on that last note, you should be careful not to do anything overly-stimulating like playing with your phone, as that will probably make the problem worse.
If you’re still having trouble, try to tire yourself out. Do some simple stretches or light aerobics to burn up some excess energy. If your brain is the problem rather than your body, tire it out with some monotonous tasks. Fold some laundry, read a book, do a little cleaning. You can also put on some soft, soothing music, though again, try to do it without looking directly at a screen if you can. Try not to think about the fact that you’re missing sleep, annoying as it is; just focus on your boring task, and soon enough, you should feel that sleepy urge return to you.