From your description it sounds like your power supply has failed. you’ll need this part [product|IF168-003] and here’s the guide [guide|926]
+
+
'''Diagnostic LEDs'''
+
+
The iMac has built-in diagnostic LEDs on the main logic board that can help you to troubleshoot the computer. The LEDs are located to the right of the battery (see photo below).
+
+
'''LED #1 -''' Indicates the trickle voltage from the power supply has been detected by the logic board. This LED will remain ON whenever the iMac is connected to a working AC power source. The LED will remain on even when the computer has been shut down or put to sleep. The LED will turn off only if the AC power source is disconnected or the power supply is faulty.
+
+
'''LED #2 -''' Indicates the main logic board has detected proper power from the power supply when the computer is turned on. This LED will be ON when the computer is turned on and the power supply is working correctly.
+
+
'''LED #3 - Note:''' This LED is not used on systems that have integrated graphics, which includes all
+
+
configurations of the iMac (20-inch, Early/Mid 2009).
+
+
'''LED #4 -''' Indicates the computer and the LCD display panel are communicating. This LED will be ON when the computer is turned on and video signal is being generated. If the LED is ON and there is no image on the LCD display panel, the LCD display panel or inverter might be installed incorrectly or need replacement.