Sleep is essential for both your physical and mental health. Naturally, we produce a hormone called melatonin at night that makes us tired and helps us sleep deeper. Unfortunately, most people nowadays are suppressing that chemical using electronics. The blue light from the screens decreases the amount of melatonin we produce, keeping us alert when our body should be resting.
To have better quality sleep, sleepfoundation.org along with many other sources suggest putting away any screens at least 30 minutes before bedtime.