Software that uses a variety of techniques to attempt to determine which emails you receive are spam. These techniques include whitelist (a list of email addresses belonging to your friends and newsletters etc that you have signed up to receive), blacklist (lists of addresses of known spammers), and a variety of algorithms that attempt to determine what is and isn't spam based on the email content. None of this software is perfect so you will end up needing to at least scan the subject lines and sender addresses of all emails tagged as spam in order to ensure that you don't miss an email that you actually want.
Don't view spam emails. Often spam emails are in HTML format and contain web bugs (external links to transparent images). Simply opening a spam email may confirm your email address to the spammer resulting in their sending you lots more spam.
This article written by Stephen Chapman, Felgall Pty Ltd.