In most cases, you'll spot when a cable is in bad shape because your device flickers in and out of charging, or it might only charge when you're holding the cable at a particular angle. Propping it up or bending it can provide a quick fix but won't help in the long-term.
You might also wonder if the problem is with the cable or the port you're plugging it into. There's an easy answer to this: change the cable. If you've got a spare that works perfectly, it's the cable. If it doesn't, it's likely the port. Double-check using a different charger to be sure.
Shine a light inside the port to get a better look. If you see any debris, you might want to give the port a cleaning, although Google advises against putting anything into your phone's port. Lightly tapping your phone against your hand with the port facing down can help dislodge buildup inside.
You might think this is all somewhat hyperbolic. It's also a bit hypocritical, as I've used fraying charging cables on more than one occasion in a rush (and later regretted it). The cost for a new cable is far less than replacing a broken piece of equipment, covering a medical bill or dealing with fire damage. Unless you're an electrical engineer with the skills to strip and repair a wire and test it afterwards, and have the desire to do so, recycle your old cable or repurpose it.

Can you play GTA 6 from an external hard drive on PS5 or Xbox Series X/S?
7 gadgets that'll instantly upgrade your Thanksgiving feast
Capcom's quirky dinosaur-fighting hero shooter is shutting down in 2027
Trump admin didn't investigate Jensen Huang before pushing Nvidia to bring him back: 'What does that mean, had Huang been investigated? For what?'
GTA 6 vault: How to open them during big bank jobs
Deceased BBC football commentator resurrected with AI for EA Sports FC: The family says it's a 'touching tribute' but some fans call it 'gross' and 'bleak'
State AGs are trying to stop Character.AI from auctioning off users' chat histories
As the US Treasury suffers a cybersecurity breach, its chief tech guy is vibecoding a Civilization clone
AI kills another coding competition: 'I was not at all interested in giving awards to the output of large language models'