A lot of things could result into wallet being hacked. for a wallet hacked, there's little or nothing you can do. It's usually better to prevent a hack than to find a way to get it back. for a new wallet, ensure you use a very strong password and if possible use a 2 factor authenticator.
never keep your private keys online or share it. be conscious of downloading suspicious content. avoid doing fake giveaways and don't give your details out. I once had an experience with this and since then, I've been careful about my wallet details. Heard coinomi wallet is one of the strongest out there as it has its own keypad.