Here is the support document regarding reinstalling macOS from recovery and the startup key combinations.
How to reinstall macOS - Apple Support
If the internal drive of your iMac has already been replaced, then the Recovery mode boot using Command-R probably will not work. The drive will need to have already been formatted and the recovery partition created.
You will want to enter internet recovery using Option-Command-R or Shift-Option-Command-R as described in the section "Other macOS installations options". And for that you will need an ethernet cable to connect your Mac to your router (best) or make sure that the wi-fi is connected by clicking the wi-fi icon at the top-right of the screen after you reboot.
If you have not already replaced the internal drive and the Mac is still bootable, you might consider using CarbonCopyCloner to clone the startup drive to the replacement, including the recovery partition, before it gets swapped into the iMac. You'll need an external enclosure or bare drive USB cable adapter for this.