At what stage of the install did the Mac freeze? (i.e. what was displayed on the screen).
What happened upon the when you restarted the Mac? To restart did you press and hold the Power button until the Mac shutdown and released and did a normal startup?
Possible problem areas:
Uninstall any antivirus and "cleaning" apps before trying installing again.
Further, you need an Apple disk installed to upgrade to Monterey since the upgrade includes an update to the Mac's firmware. That update looks for an Apple disk and write to the dick to do the firmware update. The install will terminate or freeze if no Apple disk.
Some users have problem with skipping upgrade versions and even not updating to the latest version of Big Sur. Some users have experienced problems by skipping upgrade,es like going from 10.15 to 12 (Monterey). I recommend incrementally upgrading to each sequential version. To find older versions:]
How to get old versions of macOS - Apple Support
Do you have Fusion drive? It appears iMac w/Fusion drive frequently have problems going to Monterey.