Many do not know it and when they break they throw them away, but if it has not been more than a year or if you have the warranty extension you can go to Apple and have them exchange them for new ones. It is logical considering that it is an accessory and that the warranty also covers it, but we don't think about it.
I noticed when my mother broke them, threw them in the trash and then went to the Apple Store and they told her they could give her new ones if she took them. There I was to take the old EarPods out of the bucket and clean them, which we exchanged for new ones.
Your EarPods also under warranty
Remember that with Apple the first year you have a guarantee that covers any damage to the iPhone, except if it falls into the water or if the screen breaks. We would talk about free repairs or device changes for a new one when the problem is internal and has not been caused by the user, but because it is understood that the device is bad or has a factory defect. With the Apple Care plan you can extend that warranty from one year to two, with all the benefits and help that this entails: Free technical service phone, extra help, etc.
Well, what I did not know was that the EarPods also came under that guarantee, and coincidentally they had broken both me and a family member. We made an appointment, we took them to the Apple Store and they changed us for new ones, since we are in the second year of the warranty with the extension of this. Finally Apple Care has helped us something. So now you know, if an accessory breaks, remember that it also has a guarantee and that if the deadline has not been met, you are entitled to new ones.