These are just some tricks I picked up from T's/ reading things. Kind of an alternate to counting sheep which actually doesn't work

1. Lie in your bed, flat, arms by your side, legs stretched out with your eyes closed. Locate a sound. It could be anything - your own breathing, cars on the street, outside noises, wind, rain, ticking of clocks (although sometimes it's useful to NOT sleep with a clock near you), etc. Slowly focus on that one sound for 10 - 20 seconds. Then move to the next sound. And so on.
2. Lie in a similar position to the above. As slowly as you possibly can, focus on each part of your body. Start with the toes on your left foot. Focus really clearly on them, and then move onto your whole foot. Other toes, other foot. Each leg, knee etc, until you're all the way up to your forehead. You can break it down as much as you like (ie. If you want to, you can separate each toe, and finger).
I find this one the most helpful tbh. I can get to a kind of floaty state where if for example I imagine my bed very slowly rocking from side to side, I can almost physically feel it.
A variation on this is to actually flex for a few seconds and release each part of your body as you focus on it.
3. Has anyone ever does that muscle spasm trick with you, where someone sits down and you try to lift them up, and they're heavy, but then you press down on their head for a while and then try to lift them and they feel lighter?
If you lie with your body very straight, eye closed and your arms straight up in the air, and hold them like so for at least 30 seconds, and then as SLOWLY as you *possibly* can move them down to rest by your sides, you should experience an odd sensation as if your arms are moving past your body down through the bed (or that's how I describe it). Sometimes when I'm trying to sleep I do this, I'm not sure if it's really a technique or not, but it helps me feel a little floaty, and out of it, more predisposed to sleep.
4. Again, in that same position. Imagine in your head an image of something very simple. This could also be anything (tree, dog, leaf, flower, snow, camera, cat, sewing machine, whatever). It's important the things are simple nouns, like "person" rather than "actual person you know". When I do it, they usually end up being cartoon drawings or kind of like "A for Apple" type flashcards. This gets easier as you do it. And, as if you're playing a word association game, just move from one image to another, slowly. It has to be slowly. Spend about 10 seconds on each image. (this one doesn't work so well for me because I can't keep the images going slowly and I get a little frustrated, but I thought I'd post it anyway) Of course if you can only come up with images that are negative for you, it isn't going to work.
On anxiety:
Anxiety and sleep and linked. So, chances are, if you're getting more of one, you'll be getting a little less of the other. This is why many medications for used for anxiety - eg, anti psychotics, benzos, lexapro, and also herbal supplements, make you sleepy/ drowsy.
Not many people are aware that a panic attack is actually a very simple imbalance in your body. It simply means you are not breathing in correct amounts of oxygen and CO2.
You feel fear of something/ someone/ some situation, even if this fear is so very tiny you don't even consciously recognise it. And you naturally hyperventilate a little, breathing in less CO2 than you normally would. Then you feel more fear because you're already feeling anxious, leading to more hyperventilating and a panic attack.
Sitting down and breathing slowly (and cupping your hands over your mouth and nose to recycle the air) will help calm you during a panic attack. Obviously the longer you've been panicking, the longer it will take to come down (even hours, don't give up), which is why it's important to recognise it sooner rather than later.
If you "have anxiety" this means your body is predisposed to naturally hyperventilate. The reason yoga and exercise helps relieve anxiety is because it literally forces you to keep your breathing under control. The more you keep it under control, the more you CAN keep it under control.
Also remember that the only way anxiety can hurt you is if you let it stop you from doing the things you would want to do despite its presence.