My kids have done this to several pairs, and this was always my solution in the past:
Laugh all you want! But it worked! at least, it kept the cords together, not necessarily increased the longevity of the headphones. I feel like knotting the cord will weaken it over time and so when I looked at this sad pair of headphones I had an epiphany... I'LL CROCHET A COVER! and that will keep the two wires together!!!!!
Let me just say, I felt like a genius!
Here's how I did it....
Start with a worsted weight yarn of your choice, and the recommended hook for the yarn you chose. Mine was just a scrap, and so I opted to use a size H hook.
Then you single crochet around both cords (and the tail) allllll the way up until you are comfortable. Be careful to not make your single crochets too close or too tight or it will warp. I had to manually space mine out afterwards when I realized my cord was warping!
Fasten off the yarn and get your yarn needle to sew in your tail. I just used the needle to go right back down the cord.
Then trim the excess yarn and your project will be finished!
Now you'll have a cool fancy headphone wire cover that all the kids will want to wear!!