@sanches.romero,
Microsoft 365 offers several preventive measures to protect your environment:
Defender for Office 365 (previously Office 365 Advanced Threat Protection) is one of the main anti-malware solutions. Defender monitors your environment for potential risks and any suspicious activity. It helps prevent most of the malware by recognizing and blocking the threats.
Anti-phishing protection is included in Defender for Office 365. As phishing emails are one of the most common ways to get infected with malware, this feature can really make the difference. You can define the anti-phishing policies in the Office 365 Security & Compliance Center and activate the anti-phishing protection feature. You can find a visual guide on how to set the requested policies in this blog post https://www.nakivo.com/blog/how-to-protect-microsoft-office-365-data-against-ransomware/
There are several preventive measures offered by Microsoft and third-party anti-ransomware solutions. However, please remember that the only way to protect your data is a reliable backup and recovery solution. It will restore your critical information when all the preventive measures fail.