“Malware” is short for “malicious software”. Malware is any software that is intentionally designed to cause damage to your computer or programs. The term could refer to viruses, worms, Trojan horse and spyware, to name a few. Malware exploits security defects in software. It looks for loopholes to exploit.
The best-known types of malware are a virus or worm. They are designed to spread without your knowledge. It uses legitimate software and when the software is used or opened, it begins to spread.
Viruses need you to do something with legitimate software before they begin to work. A worm does not. It can spread without you performing any action. A trojan horse is a harmful program the pretends to be a legitimate program. When it is downloaded, the hidden destructive function is activated.