Viruses and worms are malicious programs that can damage computers. Viruses attach themselves to files and spread when those files are opened, while worms can spread automatically from one computer to another without human action. Basic virus structure involves looking for infectable objects, infecting them, and then returning control to the infected program. Worms differ in that they replicate and spread automatically between systems rather than needing a host program. Protecting against viruses and worms involves keeping systems updated, using antivirus software, conducting regular scans, and employing a firewall.