This is how I do it, too. I allocate at least an hour to YouTube (in bed, using my iPad), with the not-super-strict rule to look at content that does not stimulate my mind. Videos about games, or restoration of old computers, are okay for bedtime, videos about e.g. DSP are not.
If my mind is really stimulated, this may feel a bit awkward initially, forcing my mind to "calm down and focus on the video", but at the end of the hour it's usually fine.
And then do not start thinking about a related problem again when you shut the iPad off. I made that mistake so many times.