When you use your phone before sleeping, you get exposed to blue light, which tampers with melatonin production. Since melatonin is the sleep hormone, it makes it difficult for you to fall asleep.