A 2010 iMac will run up to MacOS 10.13 "High Sierra."
You can get High Sierra using the link near the bottom of this Apple support article::
How to upgrade to macOS High Sierra - Apple Support
You model typically shipped with 4GB RAM. If you have not upgraded RAM before, High Sierra will run on that amount but will work better if you bump it to 8GB. It is an easy at-home job (ten minutes) and RAM is relatively cheap right now. This kit gets you to a total of 8GB RAM:
https://eshop.macsales.com/item/OWC/1333DDR3S04S/
This kit gets you to 12GB and is the one I used in my 2010 iMac without issue:
https://eshop.macsales.com/item/OWC/1333DDR3S08S/
Assuming your iMac is as-shipped, you have four RAM slots. Two are occupied and two are empty. Simply install the new RAM in the empty slots. Might want to blow any dust out of the slots first--ten years is a long time.
RAM Install instructions here:
Install memory in an iMac - Apple Support