Look at how the cable and phone respond
A plug that no longer sits firmly or a charging symbol that disappears with movement can point to the socket. Tell us if a charger you already use with another device also gives trouble on this phone.
If the phone supports wireless charging and you already know that works, mention it. That comparison is useful when we’re trying to separate a wired connection problem from a battery fault.

