Virus - "System is in danger!" "iCloud is being hacked!" and other warnings.
I have been getting these messages popping up from the upper right of my desktop like notifications and news flashes do. If I click on the message (see screen shot) it brings up the larger screen in Safari (see screen shot) instructing me to "Scan". If I click on this, a screen comes up that appears to be scanning my hard drive. It looks like a virus checker. I have never let this go long before closing the screen. Further, a couple of days ago I received a threatening email. It said they had bought my email address from a list and have observed my internet activity, etc. I was to send, I think it was $750 bitcoin, somewhere or they were going to send things to people on my email list, or something. I don't have the address it came from. I presume these are the same incident but could be two different situations. Screen shots of the small "notifications" and the first screen are attached. How do I get rid of this?
iMac 21.5 inch late 2012
MacOS Catalina 10.15.7
Safari 15.6.1
Earlier Mac models