It is very important for good sleep how you spent an hour before bed. When you lie down on the bed and close your eyes, it is better to read a mental or spiritual development book than to let the mind wander around or to focus your mind on something neutral, such as breathing. Focus on or on the chanting of a mantra. Counting the countdown is also a good way to give direction to the mind. You can introspect for a few moments before sleeping and give yourself necessary suggestions for self-improvement. These self-explanations given just before bedtime are taken easily by your subconscious mind and then it starts working according to them.
Due to irregular lifestyle and restless mind before sleeping, nightmares can occur instead of sound sleep.