Why is my 2016 iMac "Beach Balling" a lot after upgrading hardware?
It sounds like you have a dying hard drive, not a memory problem  - not that more memory is a bad thing!  I did some research and according to EveryMac.com your iMac has both an SSD and a regular HDD.  One or both could be dying.  Most of my drives lasted around 5 years and that one is 5 years old now.
I found this post:  https://apple.stackexchange.com/a/239723/377857 on how to fix it, but it seems like you have to remove the glass.  I did a little more research (I want to do this to my iMac) and it seems like you have to cut the glue holding the screen.  That scares me.
Since it is so difficult to do, I would probably use a program like Disk Warrior or Disk Drill (see them recommended by people all over this site) to test out the drive first.  If it's not failing, why go through the trouble of opening it up?
If you do have to change it, it might be a good idea to get a pro to do this job.  Maybe if I get more experience, I will try it myself, but not yet.
PS - In my experience, I've found that using matching RAM modules is the way to go.