Lets first look at what a Fusion Drive its a little wacky! Your system has two drive connections the 3.5” SATA port (used by the HDD) and a custom SATA blade connection which holds a 128 GB SSD.
Your data is strictly on the HDD, the SSD is strictly used as a cache drive, it holds data blocks not complete files! Which are requested more frequently. So, If your HDD died then you’ve lost any data which was on it. Hopefully you’ve got things backed up.
OK how to get your system going, you’ll need to setup a bootable OS installer USB thumb drive so you can boot up under it to break the Fusion Drive set (thats with both of your original drives installed following this guide How to Delete or Split Your Mac's Fusion Drive This should release the blade SSD. Once done using disk utility delete the partitions on the blade SSD and setup a GUID partition with a journaled file system. Now we can replace the HDD with the SSD. Do keep in mind you will need this iMac Intel 21.5" and 27" (Late 2012-Early 2019) SSD Temperature Sensor as your system won’t run properly without it as your systems SMC services needs access to the HDD’s thermal sensor which is now gone! This sensor replaces it.
With the SSD in place using your bootable OS installer you should be able to again setup the drive with a GUID partition map, then setup a partition and format with a journaled file system. Then run the OS installer of the macOS you want to use.
Here’s a link to the different macOS versions How to get old versions of macOS and follow this guide to convert the installer into a bootable drive How to create a bootable installer for macOS
Be aware High Sierra will convert the file system from HFS+ to APFS which many 3rd party OS tools won’t work properly with. In addition going higher than Mojave you’ll loose 32bit application support.