I’d advise replacing the HDD with an SSD and then installing the last supported version of MacOS, which is El Capitan. Also make sure you have minimum 4GB RAM. Do that and you have a very usual usable computer for basic tasks, and one that’s also secure. I have a 2007 20 inch set up like that and it’s great.
There are guides online detailing how to install the SSD yourself, it’s pretty simple.
very good advice !
I have had good experience with SL and ML, but the last version of ElCapitan is really stable and has nevertheless many advantages compared to SL and ML. Especially concerning security and comfort.
I gave my already retired MBP (dualCore)from 2009 (seems to be technically more or less the same as your iMac) to my daughter with ML on it. One day it went extremely slow and showed more and more beachballs.
So I gave it a nice SSD (not really expensive) and installed a fresh ElCapitan OS on it. This is the latest recommended OS by apple for those machines.
Now this "old" MBP from 2009 (4GB, not more) runs as hell, it is for all-day purposes as fast as a "new" machine.
There are even some workarounds to install even Sierra on these machines - but I didn´t until now.
Sierra ist very stable and I like it a lot on my 2011 and 2012 MBPs.
The last version of El Capitan is a very nice choice and absolutely stable. I really recommend it as well.
Tip: after installing ElCapitan or Sierra Disable the ridiculous "Transparency look" of the side-bar
prefernces --> Accessibility --> Display-reduce transparency
This ridiculous and useless transparency-gimmicks eats up performance.
Many people are disappointed at first moment after (fresh) installing of a new OS because spotlight restarts to list up and this will (dependent on your data) slow down performance. Once spotlight has finished, this will get much better.
You can also disable spotlight or reduce its activity in system preferences.