The most common attack vector for Phobos ransomware is an unsecured RDP-Connection (Remote Desktop Protocol). It is followed up by phishing emails and security vulnerabilities.
Just by following basic cyber hygiene principles such as not opening emails and attachments from unknown people, and not downloading any program from torrents, can save you a whole lot of time, trouble and effort.