I second Niel's advice. If you do have a late 2009iMac, it can be upgraded to High Sierra, and that would be a good idea to do it. But, please understand that doing the upgrade is not likely to speed up your computer. If it is running slow, there is a reason for it and that reason will still be there. When you do your upgrades, be sure to use a wired Ethernet connection as Wi-Fi downloads for these large files will often get corrupted and either not load or will have serious problems. Then I recommend that you download, install and run the free app EtreCheck. Be sure to enable full disk access and save the report. Then paste the report below under the "Additional text" icon. This report will give us a very good picture of what is happening in your computer and what may be contributing to the slowness. Then, meaningful suggestions can be made for you.