What screen size? Entry-level 21.5-inch iMacs made between 2012 and 2019 shipped with slow and under-spec 2.5-inch laptop-class mech hard drives that were were demonstrably SLOWER that drive ins entry-level 2011 iMacs. No amount of added RAM can make this drive any faster.
I agree 110% with Servant of Cats' assessment and recommendations assuming you have the entry level iMac. However both of us are working with a minimum of tech detail from you combined with "slow iMac" history here. If your computer shipped with with an optional storage upgrade (Fusion or SSD) and is still slow, something completely different could be at play.
We do not know your actual hardware config and drive performance data. If you want a machine-specific, data-driven evaluation in this setting where we can neither see nor touch your computer, please post an EtreCheck report. We can quickly and within the limitations of these forums help you determine what issues are at play without our playing a protracted game of "20 Questions" with you that could go on for days.
EtreCheck Pro is available here:
https://etrecheck.com/index
The free version will do nicely for this purpose, although the app is worthy of our financial support.
We can see hard data about drive performance, software issues and interferences, and RAM usage. Etrecheck is the development of a long-serving and trusted ASC contributor. It is a reporting app, not a "fix-it” app, expressly for displaying information in these forums to help us help you remotely. It will not alter your computer nor reveal any personal or secure information.
Please see this excellent user tip on how to post long text reports like EtreCheck's into a forum response:
How to use the Add Text Feature When Post… - Apple Community