made a video how to for what worked for me
FIX headphone iphone - YouTube
If nothing works, such as q-tip trick, un-plug in and plug in of the headphone, bluetooth speaker trick, the Setting/General/Accessibility/incoming calls (audio routing for newer software)/set speaker, then headset, turning on shazam, activiate siri...etc. TRY THIS, 1) have someone call you, 2) turn on to speaker mode, 3)turn off the speaker, 4) plug in your headphone, 5) un-plug headphone. This should work!
So I had this issue and did ALL the tricks on youtube. ALL of them DID NOT work. But this did work. You can follow all the steps he did but what I did was a bit more basic. I went to Setting/General/Accessibility/audio routing -set speaker.
Then I used gmail to call myself but I'm sure you can have someone just call you. It should answer in speaker mode. (Having someone call YOU is important because I called someone and this did not work.)
When you answer the phone and its on speaker mode hit the home button and go to podcasts or Spotify or anything that play sounds(I used podcast) then while the phone is still on the call in speaker mode play something and you should hear it on the speaker simutaniously as the phone call. then while its playing the audio hang up on the phone call.
This was the only thing that worked. I was so excited that I actually signed up for an account after 10 years with an iPhone just to post this.
Hope this helps.