Pull the hard drive fan connector toward the top edge of the iMac to disconnect it from its socket on the logic board.