There are many ways through which you can fix the message failed to send iPhone issue and some of the ways are:-
1. Check network connection
2. Check airplane mode
3. Update your iOS
4. Click on the Try Again button
5. Avoid sending message on a disconnected phone number
6. Make sure that you are texting on the correct number