I used to have this problem. I started using this program called: Flux on PC / Android, on iPhone you have this thing called "night shift".
The point of this program is that it dims the blue spectrum and helps you sleep better and doesn't hurts your eyes.
You can read more about it here: https://justgetflux.com/research.html
Thanks , I'll check this out.