Sometimes, you want to listen to music while falling asleep. What you don’t want, though, is that music to keep playing all night. You need a sleep timer!

With Apple Music, there’s no sleep timer directly in the app, which is a little confusing, since Apple did include a sleep time button in its own Podcasts app.

Don’t worry, because we’ll show you how to set a sleep timer in Apple Music so you can fall asleep to your favorite tunes whenever you like!

First, start playing whatever you feel like listening to. Then, close the Apple Music app and open the Clock app. Go to the Timer tab, click When Timer Ends, then scroll all the way down to the bottom and select Stop Playing. Set the timer for however long you need, and click Start.

When that timer runs out, the music will stop playing. Since the Clock app remembers your settings, the next time you want to set a sleep timer for Apple Music, it’ll be on Stop Playing unless you change it to something else.

What kind of music do you like to fall asleep to? Let us know in the comments!

Dave LeClair loves games on console, PC, mobile, handheld, and any electronic device that is capable of playing them! He manages the Deals section, writes articles, and does lots of behind the scenes work at MakeUseOf.