Measures to prevent ransomware include keeping systems patched and updated, securing backups offline, avoiding suspicious links/attachments, using anti-malware software, restricting access, and training staff on security awareness.