Most of these can not upgrade the GPU (24" 2009s can link ). But they can all be upgraded with an SSD and use OCLP to run Big Sur with few UI adjustments to make it work fine ( link )
Alternatively, they can setup with BOOTCAMP and run perfectly under Windows. Usually require installation with Windows 7, followed by upgrades to 10 and likely even 11 is possible (need to bypass Win11 minimum security checks)
Running Linux perfectly is another option
Most of these can upgrade the GPU to be metal compatible and run macOS Big Sur to latest (Sonoma as of 9/24). Refer to this website ( link )
Alternatively, can follow the similar non GPU upgraded path with Big Sur + UI adjustments ( link ) or Windows or Linux
These can be made much faster with running macOS from an external USB SSD
Purchase an SSD such as a 2.5" SSD with DRAM
Purchase a USB-3 (or USB-C) enclosure for the SSD to plug into your iMac
Install macOS on the SSD. Set macOS default boot to the SSD
Some more novice users finds even this is too difficult. Then its best to find someone to do this (Apple Genius Bar aren't too helpful, they just say spend $1500 and buy new mac) Here are info on how to build an external macOS bootable SSD ( link ) If bulding an external macOS SSD is beyond your ability and someone else is building one for you, read this important section ( link )
These can not run >= macOS Big Sur with more modern browser support. OCLP macOS installation maybe necessary.
Internal SSD upgrade is much more challenging with difficult to remove / reinstall double sided taped on screens. Many people crack the LCD on removal and LCD falls off with poor quality aftermarket tapes afterwards (27" especially) then the iMac is completely ruined and worthless.
https://sites.google.com/view/macs-stayin-alive/hw-tips#h.t0s2wo2t6kcz