Is there any way to be safe using a public Wi-Fi?

To ensure security while using public Wi-Fi, make sure you are using a secure connection to a Web site you trust. Do not enter a username and password, even for webmail, Facebook or anything else, unless you have a secure connection, because a hacker monitoring the public Wi-Fi connection could steal it.
To verify a secure connection, check that the browser address bar has https:// (look for the “s” for secure) and that the locked security padlock icon appears in the browser. Click the padlock to confirm you are at the right site and it has a valid certificate from a Certificate Authority you recognize. These steps confirm you have a strongly encrypted link directly to the desired site, and your communications will be “scrambled” so anyone eavesdropping on the public hotspot Wi-Fi communications cannot understand or use any of your information.
For even more security, businesses commonly use a virtual private network (VPN), technology that also establishes a secure, encrypted link from your laptop to your remote server.

For more information, see also, How does Internet security work?  and What is a certificate?