So what's the difference between malware and ransomware.
Well, malware is a piece of code that when executed on your machine, it will allow access to your machine by malicious individuals, and further malicious actions.
Ransomware attack is a process where a user will get infected by malware, then through this model, an attacker is going to access the network look for any valuable data and system.
Exculpate this data, and then go for lots of damage by first encrypting any data, any business critical systems, and also incapacitating you by preventing you from restoring any of the systems, or any of the data.