The OP wrote:
"...the computer has been running slow lately"
IMPORTANT QUESTION:
What kind of drive is inside?
If it's a platter-based hard drive, that's why it's "running slow" -- probably NOT the RAM.
What you need is an EXTERNAL USB3 SSD.
Plug that in, set it up to be the boot drive, and EVERYTHING will run MUCH faster.
You don't need to spend a lot -- a 500gb SSD will do the job and do it well.
I'd suggest a Sandisk Extreme or Samsung t5 drive.
(If you buy the Samsung, be sure to REFORMAT it and get rid of any factory-installed software BEFORE you put the Mac OS onto it).
If you have large libraries of movies, music and pics, LEAVE THEM on the internal HDD.
They don't "need speed".
Keep the SSD "lean and clean", and it will run at its best.
You can use a piece of velcro to secure the drive to the back of the iMac's stand.
You won't even see or know it's there.
You won't believe the performance improvement you get from doing this.
You'll be back here telling us how great a difference it made...
