Certain lifestyle factors can contribute to difficulty in falling asleep. These can include irregular sleep schedules, napping in the late afternoon or evening, consuming caffeine or alcohol before bed, or using electronic devices late at night. The blue light emitted by phones, tablets, computers, and TVs can interfere with the production of the sleep hormone melatonin, disrupting your sleep cycle.