If you are adding RAM because your iMac is slow, you could be wasting your money if it has the original mech hard drive. 95+% of slow iMac report se are traced to the drive, not the RAM. Adding RAM to an iMac with a slow HDD will make no perceptible difference.
As it's already apart, you can replace its old mech HDD with an SATA 6GB solid-state drive. The base 2.5-inch SATA 3GB 5400rpm drive in 2017 21.5-inch iMacs on its best day ever could achieve write/read speeds no faster than 80MB/sec. An SATA SSD in the main drive bay will do 500-600MB/sec.That's at least an 8X improvement.
https://eshop.macsales.com/item/OWC/K21IM12HE1TB/
NOTE: if you install an internal SSD, be sure to engage TRIMforce. I failed to do that because OWC said it was not needed, but later I found it was.
How to Execute ‘Trimforce’ Command with Your SSD
If you have the optional Fusion or SSD storage, something else is at play. A healthy Fusion system should not be perceived as slow, and the factory SSD practically screams speed.