Malware is short for ‘malicious software’. Common examples of malware include viruses, ransomware, spyware, trojan horses, worms and keyloggers. Viruses, for example, can cause havoc on a computer's hard drive by deleting files or making data inaccessible. Spyware can gather data from a user's system without the user knowing it. This can include anything from the Web pages a user visits to personal information, such as credit card numbers
The most common ways in which malware is introduced to a laptop or PC is by opening an e-mail attachment containing the malicious software or, in the case of spyware, by installing software from a dubious source that has a spyware installer attached to it.
A keylogger is a program that records the keystrokes on a computer. It does this by monitoring a user's input and keeping a log of all keys that are pressed. The log may be saved to a file or even sent to another machine over a network or the Internet. (https://techterms.com/definition/keylogger)
Ransomware is often distributed as a Trojan, or malware disguised as a legitimate file. Once installed, it may lock your computer and display a "lockscreen" with a message saying you must pay a ransom to regain use of your computer. This may be a fake message purporting to be from a government institution like the MOD or HMRC saying you must pay a fine. It may also be a blatant ransom message saying your files are being held for ransom and you must pay to access them again. The ransom message typically includes instructions for how to pay the fine, often by credit card or bitcoin. An example of a Ransomware attack was WannaCry (also known as WanaCrypt0r 2.0 and WCry) which hit mainly the NHS in the UK during May 2017.
As the name implies, this is software that "spies" on your computer. Nobody likes to be spied on, and your computer doesn't like it either. Spyware can capture information like Web browsing habits, e-mail messages, usernames and passwords, and credit card information. If left unchecked, the software can transmit this data to another person's computer over the Internet. (https://techterms.com/definition/spyware)
Trojan horses are software programs that masquerade as regular programs, such as games, disk utilities, and even antivirus programs. But if they are run, these programs can do malicious things to your computer. (https://techterms.com/definition/trojanhorse)
Computer viruses are small programs or scripts that can negatively affect the health of your computer. These malicious little programs can create files, move files, erase files, consume your computer's memory, and cause your computer not to function correctly. Some viruses can duplicate themselves, attach themselves to programs, and travel across networks. In fact opening an infected e-mail attachment is the most common way to get a virus.
A computer worm is a type of virus that replicates itself, but does not alter any files on your machine. However, worms can still cause havoc by multiplying so many times that they take up all of your computer's available memory or hard disk space. If a worm consumes your memory, your computer will run very slowly and possibly even crash. If the worm affects your hard disk space, your computer will take a long time to access files and you will not be able to save or create new files until the worm has been eradicated. (https://techterms.com/definition/worm)