There are a number of measures you can take to prevent your website or VPS from being hacked:
- Keep your website(s) up-to-date.
- Remove plugins, themes, or modules that you no longer use.
- Use passwords that are not easy to guess.
- Change your passwords regularly.
- Never use the username ‘admin’ or ‘root’.
- Make regular backups.
- Make sure your own computer is safe and not susceptible to viruses. Use a good virus scanner for this.