First make sure your firmware is upto date. Follow this Apple TN: EFI and SMC firmware updates for Intel-based Macs
As to your RAM, here's Apple TN on what they support: iMac - Memory specifications and upgrades.
Here's the guides on how to install the modules: iMac - How to remove or install memory
As to upgrading the HD you'll need to follow this IFIXIT guide: iMac Intel 21.5" EMC 2389 Hard Drive Replacement.
This series uses the built-in thermal sensors the HD manufactures put into their drives for testing during manufacturing. Apple leveraged the sensor as part of their heat management system. Because each company did their own thing Apple needed to create custom cables to match up with the different drives. So before you open your system check your system profile and see what drive you have. You'll need to stick with the same manufacture's drive i.e. (Seagate for a Seagate). With that said you still can use a different drive if you want to its just you'll need to replace the sensor cable out. Review the P/N here if you want to do that:
- 922-9215, Hitachi
- 922-9216, Seagate
- 922-9622, Western Digital
I would strongly recommend going with a SSHD (hybrid) drive over a standard HD drive. There you'll gain some zip in booting up and running things in general. Both Seagate & Western Digital make them.