It’s important to understand no system is 100% secure. The internet is a never-ending battle between hackers finding weaknesses to exploit and developers patching up the vulnerabilities.
One benefit of shared hosting is that you don’t have to be a security genius—the provider takes care of server security. On the other hand, you do have to put trust in the provider to do it properly.
That said, most security breaches actually happen because of user error. That’s why it’s a good idea to familiarize yourself with security practices before starting a site.
Getting into the habit of keeping off-site backups is also useful—that way you have something to fall back on if there is a breach.