Sadly, insomnia affects many of us. Most of my insomnia comes from stress - work, money, family. There's a reason I'm awake a lot at home, but sleep pretty well on vacation. Here are some things I do:
Stop drinking caffeine after 10 am and try to limit yourself to 2 drinks (coffee, soda, tea) a day.
Melatonin is a natural product your body makes. You can buy it over the counter, it works for some of us, not great for me, but it helps.
Most drugs make me drowsy in the day, but it's often better than not sleeping.
Try not to get frustrated or angry because you can't sleep, because that will wake you up.
Reading before going to bed often redirects my mind off work, so I almost always read for 10 minutes before turning out the light.
This last thing sounds crazy, but helps if you're someone with an active mind and you wake up in the middle of the night. The trick is to distract your mind from whatever was worrying you. I call it the ABC Trick. Start with the letter A and name a city or place, then B, and so on. Say to yourself A Atlanta, B Baltimore, C Chicago, etc. I rarely make it through the alphabet. Don't repeat cities, you'll remember which ones you've used, so start working to find a new one. Altoona, Brighton Beach, Chrisfield.... If you get really stuck thinking of a new one, you can skip that letter. You can do other things, like parts of a motorcycle, parts of a house, foods, song titles, etc. The real trick is to do something complicated enough to keep your mind off your troubles, but boring enough to fall asleep. I've been doing this for years. It's probably good for your memory too!