WhatsApp account will not be hacked by keeping these things in mind

You should set the privacy setting on your WhatsApp account correctly

Do not use WhatsApp while using public WiFi

Avoid adding unknown people to your WhatsApp account

You should keep the 2-step verification feature of your WhatsApp account on, after enabling this feature, your WhatsApp account will be safe.

After using WhatsApp Web in any other device, sign out of it, otherwise, your WhatsApp account can be hacked and some third person can misuse your data.