The following are not the only possible means of infection, but are some common and likely ways you can be infected:
Web pages - Either via a download, web code, or a cross-site scripting (CSS) attack, web pages can be a source of viral infection. As browsers gain more features and functions more methods for virus propagation appear.
Messages - E-mail messages as well as IM or chat messages can be a vector for viral infection. Whether the virus is spread through links, embedded code, or an attachment depends on the type of message and the client software.
Infected programs or Trojans - Running an infected program that you copied from a CD or other media (or downloaded) is a means of infection. Sometimes the virus is a Trojan, where it appears to be a useful program, but is in fact a virus.
Direct connection and infection by worms - Worms can connect directly to a computer across the network, and if the target computer is vulnerable, the worm will infect the target. This is notably different since no user action has to occur.