Upgrading the drive will probably give a much bigger performance boost than adding RAM (though that might help a little, too).
You have the options of either "going inside" or "leaving it outside".
Some folks open up the iMac and install a SATA SSD drive internally for the greatest speed. But you have to be capable of "getting in there" and doing it right, or else having someone else do it for you.
If you can accept speeds that would be about 80-85% of what you'd see from an internally-installed drive, you can "go external".
That is -- buy a USB3 SSD, plug it in, and set it up to become the boot drive.
A 500gb or even 250gb SSD can do the job.
Put your OS, apps, and basic accounts on it, keep it "lean and clean".
Leave your "large libraries" on the internal fusion drive -- they don't "need the speed".
For 2012-2017 iMacs with fusion drives, I suggest an "external SSD booter" as the fastest, easiest, cheapest, and safest way to obtain a big boost in performance and get a few more years of good use from an older iMac...