How to Clean an Apple Charging Cable: 6 Safe Steps
Based on Apple's cable-cleaning guidance: disconnect both ends, use a lint-free cloth, protect connectors from moisture, and dry overnight.
Wikimedia Commons · Fructibus / Wikimedia Commons / CC0 1.0 (unaltered) · CC0 1.0 ↗
Do not spray liquid on a connector just because a cable sheath looks dirty. These steps follow Apple's directions for Apple and Beats cables; follow other makers' instructions for their cables.