The Imac was randomly restarting itself after a few minutes of being on, research told me that power supply might be the issue
I exchanged the part but the imac still has the same issue. It is not related to over heating because temperatures read normal. I think the issue might be the logic board which is too expensive to replace without being certain.
Trial and error, you win some... you loose some. Might now sell it for parts.