Hi momoeec,
Welcome to Apple Support Communities. I see your questions above and would like to help!
First off, your iMac does not support any hardware upgrades. For your iMac, you can only do Software Updates.
It is quite odd that you had issues upgrading in the past. So, before you update to Big Sur, I would recommend to run the Apple Diagnostics test as explained here: Use Apple Diagnostics to test your Mac - Apple Support
If everything passes, I would recommend going ahead and try to upgrade to macOS Big Sur, not Catalina, as Big Sur is newer and better. Just make sure you have a backup first! You can use this article for backup guidance: How to back up your Mac - Official Apple Support
However, since you are on OS X Mavericks, you need to upgrade to OS X El Capitan first. You cannot go directly to macOS Big Sur. Use this guide to upgrade to El Capitan first https://support.apple.com/en-us/HT211683 - You can then upgrade from El Capitan to Big Sur, and use this guide: How to upgrade to macOS Big Sur - Apple Support
I hope all this will help! If you have issues during the upgrades or after the upgrades, don't hesitate to post again or contact Apple Support!
Cheers,
Jack