I had and have terrible sleep issues. These are the main culprits, but not always so; sometimes my mind is just like, "fuck u stay awake sucka," so I'll tell you next what I do for that.
-Lack of exercise: every body has x amount of energy, and as we get older, we generally use less and less of it throughout the day causing our metabolism to burn these excess carbs in the night and thus extra energy and lack of sleep. Do some cardio everyday if possible.
-Caffeine: do I even have to say anything about this one? My metobalism is especially susceptible to this drug and a cup of Joe at 10am will mean I don't sleep till 3am. I should mention that alcohol will NOT help! It metabolizes into glucose which turns to sugar in your body keeping you awake!
-Chicken and Egg: thinking about not sleeping will cause your mind to try and "solve" this issue by figuring out a way to sleep, which ironically will wake your mind up. Stress does the same thing. Try to meditate right before bed, clearing your mind of all thoughts, sounds, and distractions. I use an eye mask when I go to sleep and with it pressing on my eyes, it makes me feel naturally tired and block out the light. I also put a fan on my body which is very soothing and drowns out any outside noise.
Medication: When I follow the steps above, I don't have as many problems, but sometimes, especially if I have to work a graveyard shift, the next night my mind is all "fuck u sucka, no sleep bitch! !!" In this special case, I take Unisom. It helps me sleep and I don't feel groggy in the morning so long as I take it by 9pm, bed by 9.30 to 10pm, and up by 6am.