Malware is a name given to a malicious piece of software or code that is designed to compromise and disrupt the integrity and operation of your device and the privacy of your personal information and saved data. Worms, viruses, spyware and ransomware are common forms of malware.
Malware can infect your device through a variety of means that include being embedded in a malicious piece of software waiting to be executed, or passed through the network via a malicious link.
Once a malicious program has infected a device, its main task is to conceal itself by hiding itself from the user and from antivirus software. From there it will attempt to open backdoors to allow access to your device in the future.
The best way to protect yourself from these threats is to install antivirus software on your device. Keep your anti-virus definitions up to date to ensure complete coverage. Also check for operating system and software updates to ensure that you have no exploitable vulnerabilities on your device.