Normally after some time Headphones or Earphones have problems like one side of the headphones stop working. And you might have to bend, hold and twist the 3.5mm jack to solve the problem. But they can easily be fixed with another old earphone or with an Aux cable.
Step 1: Cutting the Wire
You will need two Headphones/Earphones, the one which you want to fix and other old earphones or even an AUX cable will work. Cut the wire near the 3.5 mm end of the earphones with a scissor. Then make a cut to remove and separate the wires in the cable.
Step 2: Solder the Wire
After the cutting, separate each wire. Before soldering the insulating coating on the wires needs to be removed. Use lighter and burn the wires for few seconds. Now do a guesswork and connect the wires. Test the headphones by plugging the 3.5 mm jack to a phone and play some music. If you are not able to hear the sound just reconnect the wires differently till you hear the sound. Do a Left/ Right Channel check to make sure both the sides are working properly.
Usually, the Gold color wire is the Ground and the Red/Blue/Green are the Left / Right Channels.
Then solder the wires with a soldering iron.
Step 3: Applying Epoxy
I am using M-seal to seal and protect joint which is a two-part epoxy and hardens after mixing but you even use other epoxies like Araldite or even Sugru. Tape the wires to make sure they aren't touching each other. And the apply epoxy at the joint and completely seal them.
Now you can enjoy your back your headphones.