I have no warranty on it now mostly use my laptop put was going to repair it and give it to my son not sure what psu it is
well you can get a replacement PSU at a decent cost (assuming you are in North America). was this going to be a PC for gaming or school? what are the PC specs? just a hard drive, ram, cpu, etc., or do you have a video card for gaming in it? It it in a tower case or slim line case?
Many Power Supply Units have fans that simply run all the time at full speed when they are turned on. However, SOME PSU's have fans that are actually temperature-controlled, a little like a case fan. They do NOT turn on right away, but will come on after the interior of the PSU itself warms up, then will change speed as the PSU temperature changes. If your particular PSU has this fancy temperature control system it will say that in its manual.
A PSU with a failed cooling fan will overheat and probably shut itself down, just as you describe. BUT if your is the fancy temperature-controlled system, another possibility is the CPU cooling system. If that CPU fan does not come on, the time for the CPU to overheat and cause a system shut-down also will be in the 20 to 30 second range.