@imacfix54445 "is it really that costly for an older version of mac." you can get the logicboard for around USD $200-250 and repalce it yoursel. Here is the guide for it iMac Intel 27インチ Retina 5K Display ロジックボードの交換 In general, with every repair half the cost is commonly for labor, which makes it so expensive. Yes, a legit shop would probably charge that price.
When you plug your iMac in (and I am sure you made sure you have a working outlet :-) check the back for the diagnostic LED's (A). For now, focus on LED1:
It indicates that the trickle voltage from the power supply has been detected by the main logic board. This LED will turn on when you connect the iMac to a working AC power source. The LED will remain on as long as the computer is on or asleep.
If no LED is visible:
Disconnect the power cord from the computer and wait 15 seconds to reset the power supply and LED status.
Reconnect the power cord and check the LED status again.
Verify the AC source.
Verify that a known-good power cord is connected.
Verify the cable connection between the AC inlet and the power supply.
Verify the cable connection between the power supply and the logic board.
Verify the power supply.
It would be odd (but anything is possible) that your logicboard all of a sudden is dead. I would investigate this a bit more before spending any money.
B. Coin Battery Voltage Test Pads
Shut down and unplug the iMac. Allow approximately two minutes for the power supply to discharge.
Measure the coin battery voltage by using a voltmeter set for DC. Place the probes on the pads (negative probe on left
pad, positive probe on right pad) in location B. If the voltage is 2.7 volts DC or less, then the coin battery
should be replaced.
C. Real-Time Clock (RTC) Reset Pads
Caution: Do not make contact with any of the surrounding components or traces while performing this procedure. Some of the smaller components can be broken off very easily. Shut down and unplug the iMac. Allow approximately two minutes for the power supply to discharge. Reset the RTC by shorting the pads in location C. Use the tip of a flat-blade screwdriver to touch both pads at the same time.