Go to Safari > Settings > Websites > Notifications, and remove or Not Allow notifications on all the sites on that page. I'm guessing on the location, because I can't exactly remember it in OS 12.7 if that is what you are using. I did find this Support Article for OS 12 that may be better at finding the notification.
Turn off notifications for an app or website on Mac - Apple Support
You do not have a virus, it is just Malware trying to scare you into purchasing McAfee software. Please respond back if you are not able to find those locations as there is another option to run EtreCheck to see if there have been any files installed that run on startup, but most likely it is simply a notification that has been allowed to run.
Using EtreCheck - Apple Community