You can install Linux Mint onto the iMac assuming the internal hard drive is still healthy. It is a non-Apple OS so it will require you to learn a new OS. Linux is not for everyone, but it is a great way to extend the useful life of older computers since it gives you a current non-Apple OS which supports the current versions of many popular web browsers (Firefox, Google Chrome, Vivaldi, and others), plus you have access to LibreOffice and lots of other free open source software within the Linux Mint software repository.
Linux works best with at least 4GB of memory, but can be used with as little as 2GB if only a single app is open and only a couple browser windows/tabs are open at one time. You can even test drive Linux Mint by choosing the "Live" option when booting the Linux Mint USB installer. Keep in mind Linux will run extremely slow when booted from the USB stick, but will run great when installed on the internal drive assuming it is still healthy.
You may even be able to check the health of the hard drive when booted into the "Live" mode of Linux Mint....check to see if the app GSmartControl is on one of the menus (may be located on the "System" menu of some Linux distribution)....feel free to post the complete GSmartControl health report here and I will review it. This hard drive health report can give us a good idea if the hard drive is still healthy. Sometimes another Linux app may be installed which has the same ability. A bootable Knoppix USB stick definitely has GSmartControl installed by default so that can be used to check the health of the iMac's hard drive.
Edit: GSmartControl may be on the "System Tools" menu instead. I am not currently at my Linux system to check.