HAs anyone ever heard of competitive Minecraft? No, it's not a building competition lol. This is competitive Minecraft:
I do it myself (it's actually really fun if you get into it, many CSGO players also do this)
Do you press escape when you exit out of YouTube or press the "Exit Fullscreen" on YouTube? Also, what is your CPU as I think it MIGHT be a CPU problem with slow load times and freezing but it's very unlikely.