when you watch youtube sometimes it shows inappropriate videos and I think it's haram to watch youtube
Nowadays, western culture is everywhere. Many, many videos contain women who aren’t properly dressed, music, swearing, etc.
If you’re a strict Muslim, the best I can offer is yes UNLESS it’s only for the sake of watching Islamic lectures/listening to Quran recitation because these videos don’t really contain music or nudity/haram.
I would say video tutorials also wouldn’t be haram, though if you’re a male, you would have to watch videos made by other men and vice versa. If they have music you could mute the video, or you could just Google tutorials instead of watching videos.
So as long as you stay in the boundaries of what is halal, it doesn’t necessarily have to be haram. And not every video contains women/music, but just weary and cautious.