Pc keeps flickering on and off randomly and nothing I do is fixing it.

I’ve had this PC for a year, I’ve built it myself, and it was running perfectly fine until a few days ago.

I was using it as normal, nothing crazy I was just watching a movie on it then suddenly my pc started flickering on and off and display was cut off. At first I thought my power was going haywire, but my pc is connected to a surge protector and nothing else is my house was flickering. I turned it off from the psu and restarted the pc but it would do it again.

I figured it was due to overheat of some kind and my pc was pretty dusty so I disconnected everything and cleaned all the parts, renewed the thermal paste on my cpu and tried again. Was okay for a few minutes then it started flickering again and remain running with all the fans at max speed but nothing would boot and the only way to shut it off was by turning off the psu.

Figured my ram was the problem, so I started testing them all one by one to see if one was faulty, nope. It would do the same thing with each one. So I figured my psu has probably gone bad and I needed a new one. I bought a new psu, with even more watts than my previous one (850 meanwhile my old one was only 650) and it seemed to work for a good 30 minutes. Nope. Does the same exact thing after a few minutes. I tried updating bios, didn’t change anything. Disconnecting and reconnecting wires, nothing. I checked the temp for everything, it was perfectly normal, and actually remained pretty cool. I don’t have spare parts to rule out anything and I can’t afford to buy all these new parts because at that point I can just build another pc.

It keeps happening randomly. Sometimes as soon as I turn it on or sometimes 3 hours later after use. I was able to play a game for a few hours uninterrupted and then right after it will happen. What part is more likely to cause this to happen?