I went ahead and installed Windows so I could start using it until I figure it out. I just assume to download a Mac dmg to a thumb drive and plug it into the iMac on startup. That is how I got Windows on there in the first place. What is the correct protocol to do what I'm trying to do?
I have a suggestion for you. I did this on an early 2015 Macbook Pro not long ago. I upgraded the mechanical drive to a SSD that was of course "Out-Of-The-Box" wiped with nothing on it. After installing it, I booted up the machine into Recovery Mode (Hold ⌘ + R) upon boot.
NOTE: Someone might argue that you cannot do this on a blank drive.
INCORRECT, if the Apple Recovery Mode is not stored on the drive locally itself will download the needed software. You will either have to ethernet the device or add it to a wireless network when prompted.
I would recommend partitioning the drive to APFS or Mac OS Journalized if you are dealing with Mojave - Catalina.
Once in Recovery Mode you can use "Disk Utility" to partition the drive, and then install the latest version of the OS that was locked into that device. When you do this, the bright side is that the program relies on the most up-dated firmware and drivers.. meaning it should all get pushed to the new SSD seeing as it is empty.