Do not discard your phone if it is bluetooth enabled or if it has a headset plug.
Repairing the earphone or the microphone of an old phone may cost 40 euros or more. Not convenient for an old or low level phone.
But here is a way to add some life to a phone with earphone or microphone broken or not operating properly (like mine, which dropped in the water several times).
You can purchase a bluetooth headset at about 10 euros or a wired headset for a lot less. And this small investment will last for your next phone. The same Bluetooth headset can also be used simultaneously on your second phone if you have two. Connecting and using a Bluetooth headset requires some skill, but it has several benefits over wired headsets.
A Bluetooth or wired headset is still an option to prevent waste, in case your cell phone earphone or microphone does not work (fine).