I was cruelly deprived of sleep over long periods during my childhood and late teens, so I've had insomnia off an on throughout my life and had to learn a lot about this.
Even if you have insomnia and feel aweful, exercise is the single best thing. Do it early in the day, or it'll have your metabolism too high when you go to bed. Both Cardio and Weight training help.
Diet is very important. Stimulants such as sugar and caffien mess you up and interfere with your immune system too. Before bed you should not eat a large meal or too much fat, sodium, or protein. .. But some carbs before bed are great, because if you're short on them, it will keep you awake.
Clean air helps too. You can use the vacuum hose to vacuum your mattress and remove dust mites and their carcasses and droppings that are very fine and irritating dust. Then wash all your bedding, get a new pillow and a good cover that inhibits dust. You should wash all your bedding frequently and keep the bedroom floor clean too.
Make sure your room is really dark.
If you live with others, use a Do Not Disturb sign on you door handle and assert that it is respected. Just don't forget it up all the time ;)
I use comfortable ear plugs on some nights.
Routine. Having a routine helps a lot. Eventually just as your body can know it's time to get up to go to work, or that it's time to eat or exercise, you body can know it's time to sleep. Go to bed at the same time every night.
If you're worrying a lot in bed, get out of bed and write things down. Get things organized in your life and don't procrastinate. Take time everyday just for yourself to relax. For this I use meditation, but the downside is that for the first few weeks it can add stress to your life by bringing up bad memories of abuse and such. Eventually though meditation can help with breaking destructive thought patterns and once started, is the most likely relaxation technique that people will stick with. It isn't boring like Progressive Muscle Relaxation.
Bed should be a place just for sleep and sex. Don't do anything else there.
okay, that's it I think heh heh :P