I received iMac (21.5-inch, Mid 2010) as gift I installed High Sierra but iMac is very slow.
For that 2010 iMac, I would probably stick with High Sierra after replacing any hard drive with an SSD. That will get you more performance...
I agree with
@DeltaMac about the SSD.
Your Mac will fly with a High Sierra and a SSD. If it is the original, the internal HDD is super old and even if it was new, a SSD would be like using a totally different computer.
If you do not feel comfortable with opening your Mac and installing the SSD internally (iFIxit is a great resource for step by step instructions), you can use an external SSD.
Your iMac has two main options for an external SSD, FW800 and USB2.
FW would be faster, but almost impossible to find a FW SSD. I have made FW SSDs with FW800 SATA enclosures and SATA SSDs.
USB2 is slower, but you can use many modern external SSDs. A lot of people on the forum like the Samsung T5 and T7.
Either option probably won't improve sequential read and write speeds over the internal HDD, but random read and write speeds will dramatically improve.
Sequential speeds are like transferring a bunch of files from one drive to another, and random speeds are what makes your OS feel "snappy" and how quickly the computer responds.
Even on the not ideal external option, I bet you that your Mac would feel totally different with an external SSD. That said, I would look into the internal options if you are up to it.