Evidence suggests that too much light before bed disrupts your circadian rythrms. Some people believe that blue light in particular is the cause but I think the case for that is shaky, and that it makes more sense by far to cut down on all wavelengths.
Now hold on, you say, my phone comes with a brightness slider already.
True. But I've found that in absolute darkness I can't get my phones dark enough with built in controls.
Enter Screen Filter, a free app that can make your screen dark. I mean really, really dark. You'll very quickly realize why your built-in brightness slider isn't doing enough: they are protecting you from yourself. In a bright room you can easily set the screen so dark you can't see anything. Including how to make it brighter again. Luckily they take a page from a bygon era of PCs, and automatically restore the screen to normal unless you confirm your setting within 10 seconds.
This app is free, has no ads, and works really well. I strongly recommend it for night time use. You might also be tempted to hope you could save battery life by turning down the brightness this way, but that's going to be hit or miss. If you have an OLED display that will probably work. If your display has a backlight, however, your battery probably won't benefit. This program works by inserting itself into the display pipeline, decreasing the pixel values just before rendering them to the LCD. Power consumption depends on the backlight, not pixel values. A side effect is that extreme levels of light reduction reduces the dynamic range of your display. In practice I haven't noticed this much, and even if it were worse it's a small price to pay for better sleep.