USB cables have two functions. USB cables transfer data between devices and charge connected devices. You can connect a USB data blocker like the Juice-Jack Defender or the PortaPow USB Data Blocker to ensure that the USB cable only charges your device and doesn’t allow access to your data.
If you don't need to charge multiple devices with different connections, it may be more convenient to carry a power-only USB cable.
Power-only USB cables look identical to regular USB cables. However, these cables only allow the transfer of power from the charging station to your phone. With no data connection between your device and the charging station, there's no path for malware to reach your device.