A firewall does not block adware or spyware from being installed at all.
Firewalls block ports and can prevent many forms of intrusion - adware and spyware come in on port 80 (web) so a firewall does nothing here - unless you have prevented web access as well.
Generally using Firefox instead of Internet explorer will dramaticly reduce the amount you get primarily because there are more exploitable areas in IE than Firefox (so far)
Indeed - staying away from many warez, porn, and filesharing type sites will greatly help as well - but it will not entirely save you - and will make your life dull
I use a combination of Lavasoft's Ad-Aware SE and Safer-Networking's Spybot search & destroy 1.x - remember to update both regularly.
Currenty - There are a few really ugly ones out there that niether will remove - for this you will need to either use HiJack this (Do not use if you are not familiar with the registry) or use regedit to modify your registry.
A common plan with these ones is like this; (do not follow this if you are not familiar with the registry)
-end task on the process (rundll is masked for a current one - but many other names can be used)
delete the files in question (often one in c\windows\system32 and the others in your profile's temp dir
enter the registry and go to ;
hkey_cur_user\software\microsoft\internet explorer\main
hkey_users\(all the s-x-x-x hives)\software\microsoft\internet explorer\main
hkey_lm\software\microsoft\internet explorer\main
- and look for unexpected key modifications to home page and search defaults
Be sure to remove unwanted startup apps as well from hkey_lm\software\microsoft\windows\current ver\run and \runonce