Ransomware is a type of malware that denies access to files or computer systems until a ransom is paid.
Ransomware can get onto your device in the same way as other malware or a virus, for example by:
visiting unsafe or suspicious websites
opening emails or files from someone you don't know
clicking on 'malicious' links in social media and peer-to-peer networks.