@alizag first check your phone's charging port. Make sure it is free of any obstruction, does not have any corrosion or bend pins. If that looks good, then it is time to change the battery. Use something like [https://www.youtube.com/watch?v=RvTjxmzIdqs|this video] to help you with that. If a new battery does not resolve this either, you do want to consider to replace the daughter board (charging board). It looks [https://www.aliexpress.us/item/2255800675039426.html?gatewayAdapt=glo2usa4itemAdapt&_randl_shipto=US|like this] and the removal is actually shown in the first few minute of the battery replacement video.