The thing is, Apple doesn’t make the parts needed to repair such a relatively old machine anymore. So if there is some issue with the power supply or with the main board from heat, the only option might be to get a similar machine off ebay and cannibalise it for parts. That is not a small undertaking, requiring considerable technical know-how.
It might still be something simple like dust buildup or bad thermal paste. If you take it to a Mac shop they would know how to give it a simple clean. But if that doesn’t do it it looks like some kind of hardware fault.