Why your phone stops charging even with a brand new cable
You bought a new cable and it did not fix it. That is useful information, not a waste of money, because it eliminates the most likely cause and points at the second.
The second cause is lint.
Start with the port
Take a torch and look into the charging port on the phone. Not a glance. Actually look, from a couple of angles.
What you will usually see is a compacted grey plug of pocket lint at the bottom. It gets pushed a little further in every time you insert a cable, and over a year or two it forms something with the consistency of felt.
The connector then cannot seat fully. It makes partial contact, so the phone charges intermittently, or only at a certain angle, or stops the moment you move it.
Clean it with something wooden or plastic. A toothpick, the tip of a cocktail stick, a plastic spudger. Power the phone off first, go in gently, and scrape toward yourself rather than digging.
Do not use a metal pin. Those pins are tiny and the pads they touch are tinier, and I have replaced boards that were fine until somebody went in with a paperclip.
Do not use compressed air aimed straight in. It compacts the lint further.
Nine times out of ten, that is the whole problem. I have a drawer of dead chargers at home and none of them died of anything interesting.
If the port is clean
Work through the chain, one piece at a time, changing one variable per test.
Try a different wall adapter with the same cable. Adapters fail more often than people expect, particularly cheap ones that have been through a few hot summers in a car.
Try the cable in a different device. If it charges that one, the cable is fine.
Try charging from a computer's USB port. Slow, but it tells you whether the phone accepts a charge at all.
If it charges from one source and not another, you have found your answer without any diagnosis at all.
The cable question
A new cable can still be a bad cable.
Very cheap cables are frequently made with conductors thinner than the specification calls for, which means voltage drops along their length and the phone sees less power than the adapter is sending. A two metre cable of that kind can fail to charge a device that a thirty centimetre one charges fine.
Cables also have to negotiate. Fast charging standards require the cable and the device to agree on what is being delivered, and a cable without the right internal components cannot take part in that conversation. It will still charge, slowly, or not at all on some devices.
Buy cables that state a wattage rating and, if you need fast charging, buy one that names the standard your device uses.
Signs the problem is the phone
A port that is physically loose, where the cable wobbles when seated.
Charging that only works when you press the cable in a particular direction. That is usually a damaged port or a broken solder joint behind it.
A phone that gets very hot while charging and does not gain charge.
A battery that reports a full charge and then drops to nothing within minutes, which is a battery problem rather than a charging problem.
Ports are replaceable and on many phones it is a modest repair. Batteries are consumable and they wear out, typically noticeably by two or three years of daily use.
The wireless charging clue
If your phone charges wirelessly but not by cable, the port or the cable is the problem and the battery and the charging circuit are fine.
That one test narrows things down faster than anything else, and most people never think to try it.
What I would actually do
Look in the port. Clean it. Test with a known good adapter and cable.
If it still will not charge and the phone is under three years old, a port replacement is usually worth paying for. Over five years, with a battery that was already tired, I would put the money toward the next phone and not feel bad about it.
And keep one good cable at home that you know works. Diagnosing anything is far easier when one component in the chain is above suspicion.
