If you like to doze off with music playing, you can use the timer to automatically turn your music off so that it doesn’t play all night.
In the timer app, tap When Timer Ends → scroll down to the bottom and tap Stop Playing. The Timer will automatically turn off your tunes after whatever length of time you set.