It’s true that better maintained devices (or anything) last longer and perform better. The same goes for these devices that you plug into your head.
This article covers a broad range to do’s and don’ts to observe when cleaning ear buds. But it is worth also checking for own device specifically, as mine for the Anker Soundcore era buds actually says to use running alcohol. Note though that nearly every guide does state you should apply rubbing alcohol to the cloth, and not spray or apply it directly to the device being cleaned.
See https://www.androidpolice.com/how-to-clean-and-care-for-your-wireless-earbuds/