WordPress is one of the best platform for blogging, but like all other blogging platform wordpress is not prevented from Spam comments and trackbacks.
Though the best feature of wordpress is its plugins. There are so many plugins available in wordpress plugin directory which can be use to do anything with wordpress.
Akismet is one such plugin which prevent your blog from spam comments and trackbacks.
Though to activate the plugin you need WordPress API key. WordPress API key is free to get. All you need to do is create a free profile at wordpress.com and under your profile. You can get you API key.
Here is a screenshot which shows how Akismet wordpress plugin is saving me from wordpress spam comments.
This is one such plugin which every wordpress blog should install after installing wordpress.