Good news. Search engines block virus-infected sites
The sites we visit can host viruses and other malicious code, either voluntarily or unaware, but Google and other search engines visit sites with their robots very often and are able to select the infected sites.
When Google finds an infected site, or is suspected of operating illegally with its site to detriment of visitors, the owner is informed, the site is excluded from search indexes and is also reported on a blacklist.
Not only that, even the main browsers, such as Firefox, Chrome, Safari, Explorer, Edge, Opera, etc., have a control to select the sites registered in special black lists.
If a site is classified as a blacklist, when you try to open it you are warned with a window to ask if you want to continue at your own risk, or if you prefer to give up.
Why do they do this job for free? In fact they do it for their economic advantage, if the web works properly there are more users who surf and trust.
You may also be interested in the following lessons: