You don't. Hacks target the exchanges wallet by finding exploits and not the user accounts separately. If you want your funds to be safe, use exchanges for trading only and withdraw to your personal wallet.
I love it when people say this. How the heck do you 'trade' if you keep your coins in the wallets... You don't.
IF you're holding, then yes, keep it in your wallet. If you trade it makes no sense.