All devices connected to the internet are exposed to ransomware attacks. However, you can avoid most of them by avoiding downloading files from unknown sources and avoiding opening attachments sent from unknown sources.