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.
To speak frankly, hackers is considerbly dangerous, their skill is very flexible and quick. When they have aim to get your wallet, its hard for you to keep your wallet. If you can get away from hacker, you must be good in IT. This is the trouble which makes many users get panic about their account. To keep away from hacker, you can put the crypto on cold storage and tight it at secure location. In addition, you have to keep your crypto on exchanges for active trading only. In anyway, In this crypto market, you have to prepare for the loss ,this market is absolutely risky.