Hope you are satisfied with the answers given by our dear Samsung Community members here.
May I add that, Samsung charging problems occurred due to many reasons. Some are related to software and some related to hardware. In such cases, I will guide you with the below steps in order to identify the issues.
A) How to Update
1.) Go to Settings > About Phone > Software update.
2.) Tap on Download if available and install.
3.) Follow the on-screen instructions.
4.) Then, reboot your Samsung Galaxy device.
B) Close any third-party apps in the background interrupting the charging.
These are likely the causes as to why your device might not charge, and most can be fixed without any extra support. The most common reasons for a device failing to charge are:
1) Clean the faulty cable, charger, socket, or adapter of any liquid, sweat, moisture, etc.
2) Remove any Dirt or debris in the charging port by clean fiber cloth or cotton buds.
3) Test your accessories with other Samsung Galaxy device.
4) Charge your Samsung Galaxy device with genuine Samsung Charger, cable & adapter.
If the problem persists, please bring your device to Samsung Authorized Service Center near you.
Hope this content is helpful and your problem gets solved.