Computer issue

So I have been having some trouble with my computer. Last week it started to be unwilling to start up. I press the button right, then it sounds like its starting for 1 sec and closes and reboots. It keeps doing this with sorta staying on longer and longer every try. It eventually boots up properly (taking about 30 minutes) and stayed on fine. That's untill today. As I just got home and started doing my thing on it. I reboots for no reason.
It's a pre built computer from ASUS (Asus Essentio CM6650) and I have had it for 2-4 years now with no issues whatsoever. I have been trying to find a reason behind this so I could know what parts I need to replace. I really can afford only one piece of hardware so I would need to know for sure what's wrong with it. I tried to put it to sleep mode for overnight instead of actually closing it, but it still gives me the same problem. I have just reinstalled windows on it.

Does anyone know? :( Please..?

Can't be entirely certain to be honest, but from what you've described that sounds like the PSU is on its way out.

I've had a few go personally and at work and it was always the same kind of problem as you describe - failing to POST, then it would boot but would also just loop on restarting at some stage.

+1 for PSU