There are a couple of things to do to prevent password attacks. Starting from the basics – avoiding public hotspots, configuring 2FA/MFA authentication, enforcing strong passphrases, and avoiding the same password for multiple accounts.
Good internet hygiene, browsing only secured websites (always checking for the padlock icon before the URL), using a VPN and HTTPS everywhere plug-ins will give you an extra layer of security.