Make sure to connect the charger directly to the laptop since multi-port adapters, docks, hubs may not let the full power of the charger to reach the laptop.
Also keep in mind that rotating the connector of the charging cable 180 degrees upside down can sometimes make a difference if the port is half bad (charger, laptop, or even the cable).
I find that the USB-C ports on the Apple laptops seem to attract liquids as I find so many of our organization's Macs with corroded contacts on the laptop's USB-C ports which cannot always be seen by looking into the ports. But connecting/disconnecting multiple times can sometimes remove some of the corrosion (or even oxidation) to allow it to work.
However, if all of the ports have the same issue, it tends to indicate a charger/cable issue or a bad Logic Board or possibly a bad battery. You should have Apple or an Apple Authorized Service Provider examine the laptop to provide you with a repair estimate. It is a good idea to take your charger & charging cable to be checked out just in case.
You can try running the Apple Diagnostics to see if any hardware issues are detected although the only useful diagnostic result is one which reports an issue.
Actually today Apple told me that performing a "Restore" of the T2 firmware should be tried as well to attempt to resolve these issues, but I'm not really sold on the idea this would have any bearing at all. It would help if Apple would explain their reasoning here as it definitely is not apparent to me. Thought I would mention it since Apple may insist on this when examining the laptop. Make sure to have a good backup before taking it in for service.
You should always have frequent and regular backups of your computer and all external media (including the cloud) which contains important & unique data.