My Android And iPhone Had The Same Problem: Lint!
So you've got a smartphone with a USB-C power cord that doesn't seem to work as well as it did when it was new. You've tried different cords, you've tried different outlets, you've tried different chargers. You've even gone in to your mobile phone carrier to see what they could do, and they just said "shoot, I don't know, maybe it's broken." Your phone is not broken, and it's quite likely your cord isn't broken. They're just dirty.
As someone who uses an embarrassing number of cords and gadgets on a daily basis, I've experienced my fair share of user errors. I've seen non-charging cords in all sorts of devices. I've even seen a non-charging Lightning cord for an iPhone, and those are supposed to be designed specifically to be easy and near-impossible to misunderstand.
My iPhone cord doesn't work, how do I fix it?
I had a Lightning cord that would not charge an iPhone, no matter how many wall ports I tried. For that situation, a two-tiered comedy of errors was the culprit. One part of the issue was that the cord was not made by Apple. It was an off-brand, cheaply made, and likely contributed to the second part of the mishap, which had to do with a miniature piece of feather that'd gotten stuck in the iPhone's charging port.
Once I removed the debris in the iPhone's charging port, I noticed a tiny bit of what looked like dirt. I inspected the charging cord closely and noticed what looked like a burn mark on a marshmallow. Apparently with this situation, the combination of the terrible, unregulated-power power cord (again, off-brand), and the debris between the metal of the cord and the metal in the charging port created a super-tiny fire.
I never noticed the fire because it was likely over not long after it started – and might not even have produced a visible flame, just enough to fry a section of the feather. This burned-up debris then stuck to the cord's head and the port inside, stopping a full connection from occurring. So I used a toothpick to lightly scrape all contact points clean* – and bang! It all worked once more.
*NOTE: I've seen this done with a SIM card pin, too. No matter what you use, make sure the cord's opposite end is NOT PLUGGED IN while you clean it. That goes DOUBLE for 3rd-party cords.
My Android phone won't charge, how do I fix it?
The USB-C was originally meant to be the savior of the USB universe. Imagine a plug that could plug-in immediately, no matter which side was UP when you made your first attempt? Previous USB connectors (and the USB connectors on the computer end) needed to be viewed to plug correctly (or it'd take at least 3 tries before you'd get it right).
The new design for USB-C was basically perfect, and remains excellent, and I wouldn't have it any other way. It only has one major flaw. That flaw is the perfect little hole in the cord's tip and the lovely little moat in the port. Both of these spaces are ideal for collecting lint.
Before you go flipping out about your USB-C cord or your phone's inability to charge – or keep a cord in tight – grab a toothpick*. Use the pin like a scoop, and pull out all the lint. There's bound to be at least SOME lint in your phone's port.
*NOTE: Like what's said above, when you clean your USB-C cord, make sure the opposite end is not plugged in to power when you're cleaning it. Wouldn't want to get a lil' shock.
You can also (lightly) scrape these ports if they're dirty. As it was with the iPhone cord in the example above, so too could it be possible here that you're using a 3rd-party USB-C cord that's not made according to official spec. It could be blasting power into your smartphone at levels that are unsafe – and make for some particularly toasty lint in your charging port.