Why is the older iMac I just got constantly shutting itself off?

Episode 913 (45:41)

Ed from Irvine, CA
Apple iMac

The Mac reseller that Ed took the computer to replaced the power supply, but couldn't get it to boot all the way up before it shut itself back down. Leo says it could be overheating. Make sure to have the fans cleaned out so the air is circulating in the computer.