With the hinge free to move, the iMac will be unbalanced and hard to work on. Repairs can be completed as shown, but are faster and easier with an iMac service wedge.
Before beginning any work on your iMac: Unplug the computer and press and hold the power button for ten seconds to discharge the power supply's capacitors.
Be very careful not to touch the capacitor leads or any exposed solder joints on the back of the power supply. Only handle the board by the edges.