Your system only has two SATA ports and both have something attached - HDD & ODD (Optical drive). So you'll need to give up one for the SSD.
So if you give up your ODD you can switch it out with a special career iMac & Mac mini Dual Drive Enclosure to hold the SSD drive. Here's the IFIXIT guide: Installing iMac Intel 21.5" EMC 2308 Dual Drive
Now the HDD is a bit trickier! You'll need an adapter frame to hold the smaller 2.5" SSD drive where the 3.5" HDD sits and you'll need a special in-line thermal sensor to replace the HDD's internal sensor OWC - In-line Digital Thermal Sensor for iMac Late 2009 - Mid 2010 Hard Drive Upgrade. Lastly, you'll need the Universal Drive Adapter to support your old drive externally so you can install & migrate your stuff over to the new drive. And of course you likely have a smaller SSD than what the HDD was so you'll end up with needing to get an external HDD to hold all of your stuff. For reference heres the IFIXIT guide for this: iMac Intel 21.5" EMC 2308 Hard Drive Replacement.
The last option is replacing your current HD again, but! This time put in a SSHD hybrid drive like this one: Seagate FireCuda SSHD While you'll still need the in-line thermal sensor and universal adapter. Here you get the zip of a dedicated SSD with its onboard SSD cache and the storage depth of a traditional HDD.
One last issue here, your systems SATA port is only SATA II (3.0 Gb/s) so make sure the HD, SSHD or SSD drive you put in is able to support this slower speed! Many drives are dropping support for the older speeds {Fixed SATA III (6.0 Gb/s)} You'll need to locate a drive that supports multiple SATA speeds (auto sense) like the SSHD I've listed here review the spec sheet of the drive you decide to go with to make sure its like this one, listing out the supported interface speeds.
Frankly, I would go with the SSHD drive setup as the best solution. The reason is your original HDD is getting old so it could fail soon and the SSHD will give you the zip and still larger storage space you're likely looking for.