The oldest 21.5" iMac is the iMac (21.5-inch, Late 2009) released in October 2009.
It can run anything from Snow Leopard (the last Intel version of macOS to support Rosetta 1) to High Sierra, and so might be useful for running old 32-bit Intel applications, old PowerPC/Mac OS X ones, or importing DV digital video from a MiniDV or Digital8 camcorder. But you can't even run current versions of Firefox and LibreOffice on it.
Also, you might pay for one repair (e.g., failed power supply), only to have another issue (failed hard drive) pop up. A 15 to 16 year old hard drive might start to fail at any time, even if it is still in good condition now.
Unless you really, really need to preserve stuff that new Macs don't support, it may be time to recycle it.