Anti-malware software is designed to protect against viruses; it just uses a more modern name that encompasses all kinds of malicious software, including viruses. That being said, anti-malware can stop an online viral infection from happening and remove infected files
https://sites.google.com/view/malwarebytes-activate-premium/home