What is Malware
Viruses need to have contact to copy itself and spread it' self around. Viruses can mess your computer to the point were it won't work.
Trojan horses seem legit but it allows access for other people. People can use trojan horses to get into your information without you having any knowledge of it.
Spyware secretly take your personal information. Like when your at a library somebody could have left a small flash drive and they can take all the information from that computer.
Ways to avoid Malware
You could install an antivirus software and keep your computer up and running. You could also install a firewall and the firewall will ask for permission for things to access your computer. That way you have control on what can access your computer and what can't.
Just doing these things can keep your information safe and your computer safe from anything that doesn't belong there.