I have been there where I wanted to pause my youtube background play which is a premium service before I dive deep into sleep. I used to do this manually, waking up before deep dive into sleep and pausing my music, which had a toll on my sleep. Then I got this trick which made my life simpler. so here is the solution.