Ransomware attacks are on the rise. The simplest way to extract money from someone is by asking them to pay for something they cannot replace. If you have ever locked yourself out of your car on a lonely road, you would easily understand the psyche of the ransomware programmers. You would pay any price to get access to your car/computer if you are ever locked out of it.
The best way to protect yourself from any ransomware attack is to have Backups.
You can choose a cloud storage solution that are currently available from multiple top-class vendors. Google Drive is one of the finest, easiest and cheapest solutions available. The best part is that it syncs across devices/platforms and you can use it on MacOS, Windows, iOS, Android and Windows Mobile.
If you are using a Mac, the best solution for you would still be Google Drive, considering the interoperability. However, if you have multiple devices from Apple, like iPhone or iPad, you can also choose iCloud. The good thing about iCloud is that it integrates seamlessly with MacOS and iOS and therefore it is a no-brainer solution for backups.
If you are interested in using on-site on-premise backup, you can get an external storage solution and backup your data on it. Again, for MacOS users, TimeMachine is the best device, though it is slightly expensive. It is still good because of seamless integration and ease of use. If you are using Windows, you can always get the drive and try THIS HERE. This link will take you to Windows Backup and Restore guide from Microsoft!