Keep a schedule
Think of your sleep time like you do (or should, right?) about your workout time: It is an appointment you made with yourself. If it was an appointment you made with your boss, you wouldnt cancel or postpone, right? So if you want to get quality sleep, you should get used to going to bed at the same time. If your sleeping patter is chaotic right now, it will take a few days to get used to it, and in these days you might fall asleep harder, but remember it is all part of the process, and youre creating a habit that will benefit you in the long run. And of course, try to wake up at the same time every day, for consistency. Your body will thank you.
Make light and darkness your friends
In order to regulate your sleep cycle and get quality sleep, you should be aware of the lighting. Evolution dictates that we are wide awake when there is a lot of light around us, and we get drowsy when the light is low (like when the sun sets).
In order to make sure that you get sleep at night, you should avoid naps (or take naps in the early afternoon and keep them under 30 minutes). During the day, try to get in some light in order to naturally energize yourself. Walk outside if you can, try not to wear sunglasses in the morning, and make sure there is plenty of light (ideally, natural light) in your office during the day. If you live somewhere where it gets dark very fast, consider investing in a light therapy box, which simulates natural light.
In the evening, in order to relax and get in sleep mode, try limiting the light sources. Turn off your TV and computer about an hour before going to bed, and resist the temptation of using your smartphone or tablet while in bed. When its time to go to bed make sure the room is dark (curtains pulled, lights off), and if you must go to the bathroom at night make sure you use a very dim light to get there, like a flashlight.
Be careful with food and drinks
You should never go to bed either hungry or full if you plan on getting some quality sleep. Both these feelings ruin your rest, but they can be managed very easily.
You should also avoid caffeine and nicotine a few hours before going to bed (ideally you should only drink some in the morning, if you must). And if you think alcohol helps you sleep, think again- it helps you fall asleep usually, but unfortunately it disrupts your sleep during the night, so your quality sleep will be compromised.