To some extent, you have us guessing in that, as other have mentioned, we do not have full desprictions of your iMac nor its storage types. The latter is very imporant because about 95+ percent of all "slow iMac" posts here turn out to be caused by slow or malfuctioning storage, not a paucity of RAM. Only by seeng details can we tell if an external SSD would help performance.
The is an excellent way to do details. If you want a 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 storage 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 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
Please post the entire report. What seems insignificant to a new Etrecheck user can hold a wealth of answers for those of us who have reviewed thousands of those reports. Etrecheck scrubs any personal info if you follow the posting steps in the above article.