i would first peer into the air-intake vent slots running along the bottom just below the Apple logo (see photo) to see if that could be an issue
power the unit off, unplug it from power
set it on its back (screen pointing up)
shine a light into the vent slots
look 1.5 inches inside and see if the grid holes are plugged up (pictured in clean state)
next does the exhaust vent on the backside of the unit appear dirty
IS THE INTERNAL FAN WORKING especial under CPU load (it may have broken)?
the fan comes and and goes depending on CPU/SSD/RAM/GPU load, but you should be able to hear the fan and feel the exhaust vent for air flow (perform this check when the machine is under heavy load, not idling)
Google ways to monitor internal heat temperature on Intel iMac...
MOST LIKELY a clogged up internal is a contributing factor
that solution would be to remove the LCD screen assembly and blow out the dust -- it's the only way I know to effectively clean out the internal from dust
and a good time to upgrade to a SATA SSD
if you blast air INTO the intake to clear the grids -- you are only moving it deeper internally (what you don't want)
this routine maintenance would be a minimal charge for a shop with little risk of them damaging anything
