Using antiviruses and firewalls and not opening unprotected links or websites is one way to avoid viruses.