Trojans for OSX (not viruses or worms) have been, quite rarely, found in the wild -- such as the instance with the (pirated) iWork '08 download from a year or two back that had a trojan.
Anyway, the difference between a trojan, a virus, and a worm (three major forms that malware takes):
Trojan: A program that pretends to be something it's not -- for example, a download that claims to be a super-awesome screensaver, but actually makes your machine start sending out spam e-mails. These only ever occur as actual programs -- they just lie about what they do.
Virus: An infected file that infects a computer, which can copy itself to other files -- for example, a Word document that, when opened, copies itself to your other Word documents, as well as starting to do something evil in the background. These can occur in (theoretically) any file, including programs, but are rather rare and often have to exploit vulnerabilities in third-party programs on the host OS.
Worm: A program that is entirely, silently self-propagating, meaning it can, entirely automatically, copy itself to other computers, often by exploiting security vulnerabilities. These are also somewhat rare (though
extremely wide-spreading and dangerous when they occur) and can sometimes be stopped cold by basic network security -- such as a firewall.
A prerequisite for stopping any of these things is to keep your computer fully-patched, and all third-party programs you run up-to-date. Doing this will stop a large percent of viruses and worms (no matter what OS you're running) dead in their tracks.
To avoid trojans, the best method is to only download software from trusted sources -- you'll have to determine for yourself who you can or cannot trust, though this can often be accomplished by a simple Google search or two. Trojans cannot be ever completely eliminated because they rely on the user to, in essence, do something stupid. All operating systems are vulnerable to trojans, and there isn't too much the OS can do about it (certainly not for home users). OSX does have a bit of protection built-in, mind you -- I believe Snow Leopard has a database of known OSX trojans (though it's trivial to write a new trojan), as well as having all the fanfare around quarantine and 'safe' files. There are too many trojans floating around to give a good example of a single one.
Avoiding viruses is a little tricker, since they can masquerade as normal files. Viruses are somewhere between 'exceptionally rare' and 'totally unheard of' for OSX, so you likely don't have much to worry about anyway. Even Windows viruses have somewhat fallen to the sidelines, often in favour of trojans. The best security to avoid
any threat of them, however, is to scan downloaded files (especially from questionable sources) with a basic virus scanner (such as the aforementioned clamXav). It's probably not necessary, to be honest, but may be a good habit to be in anyway. Most ISPs and e-mail providers do scanning for viruses sent by e-mail, so you'll
most-likely be entirely safe with e-mailed files. I can't think of an example of a recent virus, though some of the recent Adobe Reader vulnerabilities tend to mimic viruses in all except the self-copying.
Worms are the most difficult to avoid, if there's a vulnerability in a network service you use. The best protection you can do is to set your firewall on, all network services (in System Preferences -> Sharing) off, and turn your firewall onto stealth mode. Also, as I already mentioned, keep your computer fully patched. I've never heard of, even a proof-of-concept, OSX worm, and numbers of Windows worms have been declining with recent releases and patches. An example of a fairly-recent Windows worm is Conficker.
I hope my lengthy rambling is useful to someone.
