If this doesn’t help, go to a study place where you have to be silent and where it’s usual to not take any devices with you.
But if you think like, I can better study if I watch YouTube or Netflix, just do it then. Do what’s best for you. For me, it’s ‘wrong’ to watch YouTube or Netflix while studying, but my sister, for example, can concentrate even more when she watch YouTube or Netflix. Just try different things and do what’s best for you. I know you can do it!
Recently I’ve limited my social media till after 8pm. Just started this last week and I actually forgot to check FB on Friday and Saturday. That’s a miracle for me. So maybe try to limit your time on Netflix and YouTube.
Also, I will pick a Netflix movie and only watch it when I’m exercising or folding clothes. So you accomplish something while you watch.
Finally, I set a timer for 15, 10, or 5 minutes and do something productive until the timer goes off. I really try to do 15 minute increments. I tell myself I can stop and do something fun when timer dings. Most times I’m willing to reset the timer 3 more times. Then after an hour I take a 15 minute break. Maybe you could use that as your YouTube break. After awhile it gets easier.