This depends on which iMac it is. If it’s an Intel iMac, it is slightly easier, and if it’s an Apple Silicon iMac, it will be a bit more difficult. If it’s a Silicon, you’d need to use Asahi Linux, or have varying support. If it’s Intel, I’m pretty sure it’s similiar to installing on a PC, but can’t say for sure. I’ll look into it more