Have you tried all the steps in the following Apple article?
If your USB-C power adapter isn't charging your Mac laptop - Apple Support
Make sure to connect the charging cable directly to the laptop since some adapters, docks, hubs may not allow the full power of the power adapter to reach the laptop.
Also, try using the other USB-C port in case the other one is bad. You can also try rotating the USB-C connector 180º upside down in case the USB-C port is half bad.
If Optimized Charging is enabled (the default setting), then macOS will periodically drain the battery down to 80% even with the power adapter connected. You can have macOS resume charging by clicking the battery icon and selecting "Resume Charging".
Is the power adapter at least 30W or larger?
Are you using any third party apps which can control or manipulate the battery/charging behavior?
If none of these tips help, then you should take the laptop, power adapter, and charging cable to an Apple Store or an Apple Authorized Service Provider to be examined.