Question Pc starts up slow and after 30 min of usage freezes

Apr 25, 2020
So until today my pc was running smoothly and haven't had any major problems. It's 5 years old but i changed the gpu a year ago and the cpu is still decent in 2020.

So here is the problem. Today i was playing some games and went to get a shower after i returned to the pc, i tried to play a youtube video i left open before i left the pc. Well i click and nothing happens. Then my mouse started lagging and dissapearing,then it just froze and i turned it off from the power button. I left it for 10 minutes then turned it on, the fans started spinning for 2-3 seconds then it turned off and turned on again. After that it did not output anything on the monitor for atleast 5 minutes and the fans were almost at full speed. It finally boots up and everything runs normally so i start ps4 remote play and start playing games on it. After maybe 20-30 minutes of playing it started lagging and pixelizating remote play's stream. I closed remote play and the system sudennly starts lagging again and it froze again and i turned it off from the power button again. Every time i tried to turn it on it did the same thing i said earlier.

I cleaned it up as much as i can and swaped the ram into the other slot but nothing happend same thing as before.

Here are my componets:
Mobo:Asus h81m plus
GPU:Sapphire Nitro+ RX 580 8gb
CPU:intel core i5 4570 3.2 ghz(turbo boosted to 3.6)
Ram:adata 8 gb 1600 mhz ddr3
Psu:the one that comes with my pc case 600w (i don't remember the exact name of my case but i know it's cooler master case that costed about 85 $ in 2015)

I think the problem might be the psu but i'm not 100% certain so any help would be appreciated.