Cheap earbuds are disposable, but don’t toss out an expensive pair. If the problem is a broken connection, you can fix them yourself with a soldering iron and electronics solder.
First locate the problem. If only one speaker is acting up, the problem is likely the connection in that earbud.
Use a small flat-blade screwdriver to pry the earbud housing apart. You may have to superglue the two pieces back together when you’re done. Look for a wire that’s broken away from the circuit board. If you find one, first remove the blob of old solder with desoldering braid (from an electronics store) or an old piece of lamp cord (Photo 1). Then resolder the loose wire with .032-diameter electronics solder (Photo 2).
Allow the soldered connection to cool and then test the earbud.
If the earbuds still don’t work, you may have a broken wire at the jack. If so, resolder the broken wire.
If neither channel is working, the problem may be in the plug or jack. Replacement jacks are available online or at an electronics store for less than $5. Make sure you allow the solder to cool down before placing the bud in your ear.