At least 1 hour or 30 minutes before go to sleep don't use your phone, because when you are on your phone your brain get so many stimulus (social medias for example in 30 minutes you feel a lot of emotions happy, sad, angry and etc...) So it's hard to sleep with quality with all this stimulus that your brain keeps processing. So, instead be at phone until the last minute, do something that relax you read a book, write how was your day, plan your next day, drink tea, go talk with your loved ones,or just go play with your pet or something like that just pick and do it. At least is this what I think and work for me. It's not everyday that we can do it but you can try when you can.