I agree that it really isn't worth doing anything with this iMac for several reasons. One the iMac only has 2GB of RAM which is not enough to run any later versions of macOS which stop at macOS 10.11 El Capitan for the 2007 model. Second, the hard drive in this iMac is very likely worn out or even failing.
You can at least check the health of the hard drive by using DriveDx. Usually any "Warning" or "Failing" notices indicate a worn out or failing drive respectively. Some "Warning" notices can be as bad as an actual "Failing" notice and have severe drive performance issues and other odd drive behaviors. Feel free to post the complete DriveDx text report here using the "Additional Text" icon which looks like a piece of paper.
Having said this did you also get the OS X 10.6 Snow Leopard DVD installer?
About the only option you really have here is to either use the OS which is already running on this iMac, but this is risky since you don't know what nasty surprises may be lurking on it from the previous owner. People should always perform a clean install of an operating system whenever acquiring a used device which means erasing the whole drive before reinstalling the OS. If you did not receive an OS X 10.6 Snow Leopard DVD installer, then this won't be an option unless you can buy the proper DVD (this iMac is not worth spending any money).
It is possible to install Linux Mint (free open source OS) to this old iMac which would give you an up to date current non-Apple OS which can use the latest versions of common web browsers (Firefox, Google Chrome, Vivaldi, etc.) plus access to lots of free open source software in the Linux distribution's software repositories. However, this does require you to learn a new OS and Linux is not for everyone. Plus Linux works best with at least 4GB of RAM, although technically you can run it using as little as 2GB of RAM depending on the workload. During the pandemic I ran Linux on an old Mac with just 2GB of RAM where I could have two or three browser tabs/windows open at one time. I would not expect to have any more open nor be able to have multiple apps open at the same time (at least none which require much memory to use). A default install of Linux Mint will likely use up about 400MB to 500MB of RAM when booted to the desktop. I was once able to customize a Linux install to utilize just about 70MB of RAM by removing much of the advanced automatic OS features, but you need to know what you are doing to make this happen (it had a basic GUI interface to run graphical apps like browsers and LibreOffice, etc.). IIRC, the built-in iSight camera may not work with Linux unless you first grab the iSight camera's firmware file from your current installation of macOS 10.6 before the drive is erased.
Keep in mind if you erase the iMac to install Linux, that you will not be able to reinstall macOS without an OS X 10.6 Snow Leopard DVD. While it is possible to create a bootable macOS 10.11 El Capitan USB installer, I would not expect macOS to work well with just 2GB of RAM. You would need another Mac from 2008 to 2015 to create the bootable macOS 10.11 USB installer:
How to create a bootable installer for macOS - Apple Support
Always plan ahead before erasing a working OS since Apple does not make it very easy to get working macOS installers at times.
Like @KiltedTim says, it is not worth spending any money on this old iMac. Even if you find Linux to your liking, it would be risky purchasing a memory upgrade for this system because Macs are very picky about the memory they use. Unless you know you were installing original Apple memory modules, or memory from OWC, or memory from Crucial which are actually marked as "Mac Compatible" or "For Mac" on the memory label itself (along with the correct memory speed & pins), then you are likely to waste your money on incompatible RAM.
Using the currently installed OS X 10.6 can allow you to experience the old computer as a Mac, but if you are interested in experimentation and possible slight usefulness, then Linux is definitely an option as long as you know the risks and prepare in advance (such as making sure to grab the iSight camera firmware and having a plan to reinstall macOS if necessary).