my rx580 currently lags out stucks at forza horizon 4 which is i was playing at ultra settings with so good fps but then now it starts as normal then like 1 min later it lags out freezes and loses framerate and when i boot up my system sometimes i hear something like coil whine but not at all boot ups but its not coil whine too it disappears secs later.
when i play valorant i get good fps like 280-500 but after being afk for 5 min my pc shuts down
sounds like something is overheating or you might have a PSU issue.
Download and run OCCT CPU,GPU, & PSU to see if the PC shutdown or overheats during the testing. keep an eye on the PSU outputs while testing and temperatures and Fan speeds.