When my youtube switches to a new video in a game i go from like 50ping to like 500 ping for like 5 seconds, even if i alt tab go to google i get huge lag spikes
Sounds normal to me. Gaming is a latency sensitive task. Using the internet while gaming can be detrimental to latency performance, especially on slower connections. Packet prioritization software should help with the issue.