It seems to be more and more common that Safari seemingly randomly pops up with a message to let you know that your Mac has been infected with malicious or suspicious activity. In fact, it's not random at all, and is usually caused by accidentally visiting unfortunate sites (most commonly when we enter a URL slightly incorrectly).
Unfortunately, the message will make it sound ultra-scary and the only way to fix the issue is to call a number for immediate support. DO NOT CALL the number listed! They will tell you that they are contracted by Apple to resolve this issue when in fact, they are not. There is absolutely no connection to Apple at all. In fact, very bad things will happen if you do this (resulting in loss of data, compromised credit cards and other bank accounts). Fortunately, there is an easy fix for this that takes about 15-20 seconds.
To rid Safari of this message (or a similar message), do the following:
To Quit Safari, go to Safari > Quit or press Command+Q. If you can't Quit Safari using either of these methods, you will need to Force Quit. To do this, click and hold on the Safari icon. When the contextual menu appears, choose "Force Quit". Alternatively, you can go to Apple Logo > Force Quit... to Force Quit.
Shift + Open Safari
Next, we need to hold down the Shift key while opening Safari. It's important to be holding the Shift key down the entire time, or this will not work. When Safari is open, you can release the Shift key.
Next, turn off your WiFi. Do this by clicking on the WiFi signal in the menu bar and choosing "Turn Wi-Fi Off".
Open a Website
The next step is to open your favorite website (for example: www.allgaierconsulting.com/techtalk). With WiFi disabled, this may sound like a crazy idea, but trust me, it's necessary to resolving the issue. When you do this, you will receive a mesage letting you know that the website cannot be found. This is normal and expected.
Lastly, we need to re-enable our WiFi. To do this, click on the WiFi signal strength icon in the menu bar again and choose "Turn Wi-Fi On". Make sure that it automatically connected to the appropriate wireless network. If it hasn't, manually select your network.
That's it! That will clear that error for you.