Ransomware is usually spread through phishing emails containing malicious attachments or through direct downloads. When a user visits an infected website without knowing it, then the ransomware is downloaded and installed without the your knowledge.