My speakers are disrupting my headphones

When I listen to music with headphones my speakers tur on the off and that makes my headphones turn off so I have to unplug then replug them. How do I fix this? If I don't have headphones in my speakers do not work and they will turn on for a sec then turn right back off. I do not know why they ate doing this but I do not like it. Can someone please help me?
Does your phone speaker work for anything else?
Try/borrow a different pair of headphones to see if it's a problem with them.

If it still happens perhaps the jack on the phone is broken.

Hope this helps.

Original thread: https://forums.imore.com/threads/my-speakers-are-disrupting-my-headphones.338977/