Computer viruses are malicious software that can damage computers. They spread by replicating themselves and infecting other files without the user's permission. Viruses become installed on computers through opening unknown files, messages, emails, disks, or when installing software without checking for viruses. Common types of viruses include Trojan horses, worms, and logic bombs. Users can avoid viruses by using antivirus software and practicing safe computing habits like not opening suspicious files from unknown sources.