Light from the sun is what keeps humanity alive. Sunlight is literally what you eat as it is the rays from the Sun which is used as fuel for plants to grow which in turn feed other animals. So even if you are exclusively non-vegetarian, chances are that indirectly what you consume is sunlight. Light from the sun has a spectrum but the human eye is unable to see the entire spectrum and responds to light between 390 – 700 nm. Within this band is something called blue light which emits light between 450 – 495 nm.
Light has beneficial effects in creating alertness, attention and reaction time. Your circadian rhythm which responds to light and dark responds well to blue light in the morning creating the feeling of being awake. However, with the advent of artificial light and especially computers, laptops, mobile phones, tablets and e-readers we are now increasingly bringing blue light into our homes well past sunset. Studies conducted at Harvard University and other places have shown that blue light particularly 2-3 hours prior to going to sleep is harmful and can lead to several types of cancer, diabetes and obesity. Blue light in particular has also been shown to suppress the production of melatonin which promotes sleep.
Scientists therefore recommend avoiding using devices that emit blue light just before you go to sleep. Many people I know lull themselves into sleep watching television or watch television well into the night, which is probably the wrong thing to do. Studies have also shown that blue light emitted from reading on your tablet or e-reader took longer to fall asleep and had reduced REM while asleep. If you need to use the computer, there are apps (I tried this free software and it visibly changes the colour emitted from your laptop) available that reduce the emission of blue light in computers etc. Unfortunately if you are using an iPhone or iPad you need to jailbreak if before you can use the available solutions. Counter intuitively exposing yourself to a lot of light during the day especially sunlight helps you sleep better during the night. Using dim light and more red light is also suggested as a remedy to the perils of blue light in your home.