Spyware is a specific kind of malware, which are software that can do damage to your computer or the use of it.
Spyware is software that is used to get information about you from your computer or produces lots of pop-up ads trying to get you to go to sites and spend your money. Quite often the links that appear from spyware will not go to legitimate sites, but to ones that will be trying to get personal information (credit card numbers, bank account number, etc) that can be used illegally to either get your money or spend your credit.
Links on regular pages sometimes will not go to legitimate sites and lead to spyware. You can also get spyware by clicking on links in spam that will download spyware on your computer. Downloading software can sometimes include spyware with it. You have to be careful when you open links in emails that they are legitimate messages (lots of spam now appears to be from someone you know but look at message carefully. Does it really sound like from them and is grammar and spelling correct for them?). When downloading programs be careful you really chose the link fro software you want as often spyware pushers will have similar links on pages. Some of the download sites have gotten better recently.
If you get spyware on your computer you will need to use a anti-spyware program to clean it off. Some anti-virus programs will clean some spyware but usually miss a good bit. The program I like best is superantispyware which is free for personal use at www.superantispyware.com for personal use. Just like anti-virus programs you need to update the program and definitions regularly and I would suggest a full scan about once a month.
The anti-spyware programs and anti-virus programs will also try to keep your machine clean generally running in background. Some like malwarebytes will only actively monitor with paid edition. If you start seeing lots of pop-0ups then run a full scan with your antispyware program.