Hello Ibagdaly. If you have a deal with one of your provider in your country they might give you youtube premium for 2 years or other premium apps as Spotify or amazon prime video this depends. But even with YouTube premium you can watch a video or listen to musiv videos inly outside of the YouTube app. however if you look your phone you will only hear the sound of the video with the screen off not able to see.
There is a way. You must go to Settings, then Biometrics and Security, Other Security Settings. Enable Pin Windows.
Before you use YouTube to get to sleep, open the Recents (The three lines on the Navigation Bar.) tap on the YT icon. There will be an option saying "Pin Window". To exit this, you must hold the Recents button and Back button at the same time. However, this will return you to your lock screen.