People should use safer browsing habit and along with that should diversify their bitcoin and altcoin holdings in as many places as possible.
Exchanges, online wallets and hot wallets in gambling sites.
If you are not using it regularly, you can just export the private key in encrypted form and remove every trace of its existence.
Small chance if hackers can find out private key of our wallet. This seems to be due to our own mistakes, usually because of a rare browser cache, no antivirus, anti-malware, send and receive bitcoin accounts in social media or email, and many causes