Can I avoid spyware by not opening attachments and not downloading untrusted software?
No. For example, older browsers allow a mild form of softcore spyware called tracking cookies to be accepted by default, meaning you will accumulate this form of spyware simply be using the web. More importantly, hardcore spyware does not bother with such legal niceties as entering only through badly designed but legal browser defaults. If your system has security holes of any sort, networks of hardcore spyware will try and often succeed in loading spyware onto your system. On one Windows 98SE system, I encountered an average of about one attempt per day to place hardcore spyware (Cool Web Search and others) into the system. While I was able to detect such placements, I was not able to prevent them entirely without extensive reconfiguring of the Windows system.