If you occasionally have trouble falling asleep, taking medications like melatonin or certain antihistamines can help you drift off.