Computer files can be protected by using strong passwords, antivirus software, and firewalls. It is also important to backup important files regularly to prevent loss due to hardware failure or other issues.