First, CleanMyMac is one of the worst items anyone can install. It has a terrible reputation on this forum since it is the cause of many problems. Plus, CMM doesn't always completely remove itself. In fact anti-virus apps, cleaning/optimizer apps, and third party security software are not needed on a Mac. They usually cause more problems than they solve since they interfere with the normal operation of macOS at a very low level where they can do the most damage. Plus cleaning/optimizer apps may change things that should not be touched.
If you have any of these types of apps installed, then uninstall them by following the developers' instructions. If you still have problems, then run the third party app EtreCheck and post the complete report here so we can examine it for clues.
I would also suggest creating a bootable macOS USB installer now while you still can by using the instructions in the following Apple article so you may have more options available if something goes wrong:
Create a bootable installer for macOS - Apple Support
Sometimes you may first need to fully update the current OS. You are way behind on Monterey updates. I believe it is up to about 12.7 or so. You can also try booting into Safe Mode to see if the OS update/upgrades will proceed.
Does this iMac use a hard drive or an SSD, or possibly a Fusion Drive? If it uses a hard drive or Fusion Drive, then perhaps the hard drive is failing.
You may also want to review this excellent article (I think everyone should read it & practice everything in it...it even applies equally well to Windows users) since it explains safe computing practices to keep your computer running smoothly, and to protect both you & your computer from all the dangers out there:
Effective defenses against malware and other threats - Apple Community