There are several ways of fixing a phone that won’t charge, and different methods are needed depending on the issue.
Sometimes, getting your charging port working at it’s best can be as simple as giving it a quick clean. In other cases, the wire can be the culprit and need replacing.
If none of these fixes work, it could be a more serious port problem — like connector point damage or corrosion — that needs a more intricate repair by a professional.