The easiest way is to go the external storage route. You can get a desktop USB3 or Thunderbolt 2 enclosure for SATA drives, like a SATA SSD, or for NVME drives. Those two examples of an enclosure+1TB SSD would be less than $70 combined.
You could use it for supplementary storage or you can even install macOS onto that drive and boot off of it. You just boot up in recovery mode (Command R), erase the external drive, and reinstall macOS to that drive and can Option-key boot off there and you're up and running.
This is much easier than replacing the internal SATA drive inside the iMac. That's an option, but it's not easy and I wouldn't recommend it at all.