If you refer to smartphones or tablets, the first strategy would be to avoid as possible the public Wi-fi locations, but as it`s practically simple, it`s recommended to have an antivirus installed and to use only the https connections
You can alwasy use a VPN, encrypting your internet browsing to potential spectators