Why does my xbox randomly shut down when i go on to youtube from playing any game for 2 hours

It always happens. I don’t know what it is.