This may need the logic board repaired which is quite advanced for many.
If both ports on each side don’t charge your battery I would connect a USB-C power meter inline with the charger so you can monitor the charger and how the handshake between responds. While it’s possible your battery needs replacing unless you are a serious road warrior yours should still be good.
Here’s one example: [https://www.temu.com/type-c-color-display-usb-to-type-c-tester-ac-meter-current-voltage-monitor-g-6017592186070228.html?|Power Meter]