Caffeine is a stimulant that can harm your sleep quality and duration. It's recommended not to consume caffeine at least 6 hours before sleep. Instead of coffee, you can have soothing drinks like chamomile tea, which has been shown to help you sleep better and faster.