Hi Djaka,
In most cases where there's an issue charging the phone, the problem usually comes down to either the battery or the charging port, assuming you've verified that your charger and charging cord are both working. On the Pixel 6a you can help pinpoint the source of the problem by setting the phone down on a wireless charger. Since the wired and wireless charging use completely different circuits, that will tell you where the problem lies.
If the phone charges fine wirelessly but not when plugged in, then you've most likely got an issue with the charging port. Unfortunately, on your phone the charging port is soldered directly onto the motherboard and will require somewhat specialized microsoldering expertise and equipment to replace, so this would be a job to take it to a shop for.
On the other hand, if it doesn't charge with the wireless charger either, then that tends to point to the battery as the likely source of the problem, so if this happens and it was mine, I'd try replacing the battery as the first step toward fixing your phone. Here's the guide you'll need in order to do the job yourself.
[guide|152516|Google Pixel 6a Battery Replacement - iFixit Repair Guide|new_window=true]
You can also buy a genuine Google battery right here on iFixit as well; I'd recommend the Fix Kit, as it comes will all the tools and adhesives needed to do the job right.
[product|IF356-330|Google Pixel 6a Battery - Genuine|new_window=true]
Good luck; let us know how it goes!