How do you take viruses

I have a curiosity to satisfy. How do you take  viruses, trojans or rootkits?

Take them browsing the Internet? email attachments? Installing programmes not originals?

Thanks.