Sorry it took me so long to do this request, I recently worked multiple doubles in a row and I was so tired! I still am tired 😅 please ignore my sleeping RBF. I promise I am not grumpy, just sleepy.
To listen while using other apps, switch the player to Picture-in-Picture (PiP) during playback — it keeps playing in a small floating window (the screen stays on).
To listen with the screen fully off, in-browser playback stops by YouTube's design. Open the video in the YouTube app to keep listening where background playback is supported (e.g. with YouTube Premium).
Open in YouTube app