Hi philipharvey44.
Welcome to the Apple (user-to-user) Community.
As you have already tried some trouble-shooting,
please excuse if you've tried the suggestions below.
( We have no way of knowing what hasn't worked for you.)
Wondering if you have tried restarting your phone.
Sometimes that puts things back in order again.
How to: Restart your iPhone - Apple Support
or
You might want to check that you are only connecting headphones to one device at a time
(Eg may not be switching between multiple devices.)
You could try "resetting" the headphones, or seeing if there is a firmware update available.
We don't know what brand they are, yett there is likely a manufacturer's website that may help.
Or
You might want to see if the tips in this discussion thread can help you solve the situation:
"bluetooth earphones connected to iphone but sound comes from internal speaker not earphones". bluetooth earphones connected to iphone b… - Apple Community
If needed:
You might want to reach out to the iPhone Support: Team:
(There's a "Get Support" link (online chat, phone, eMail etc.) at the bottom of their webpage)
iPhone - Official Apple Support
All the best :-)