My AirPods were just under two years old before I called Apple and had a pair of warranty replacements under UK Consumer Law. This process took a little while with all the required testing but in the end I had a new pair shipped.
It seems to be that Apple can replace both, both with the case, just the case of either left or right individually. I had both left and right replaced, they came in two separate deliveries and I kept the same charging case I had with my originals. You pack up your old ones and ship back via the included courier package.
You’ll want to fully charge in the case, remove from iCloud and re-pair as if they were a new set.
For information I was getting less than two hours from mine (Apple site states 5 hours on a charge) before I had a replacement. So I made sure I logged the battery level through the day using the today battery widget then just made sure I had all the evidence I needed. It was pretty straightforward in the end.
If you have a pair in the UK less than two years old I’d recommend doing a bit of testing of your own.