I understand that when you try to send an iMessage to a friend, it sends as a text message instead. I'm happy to provide some help for this issue.
While it looks like your iPhone is trying to send an iMessage, let's first double check that it's set up properly. To do so, check that you have iMessage enabled:
Set up iMessage and SMS/MMS - iPhone User Guide
Sign in to iMessage. Go to Settings > Messages, then turn on iMessage.
Also make sure that you are trying to send an iMessage to someone that is using iMessage. This would require that they're using an iOS device, or a Mac. You can learn more about the differences in iMessage and SMS/MMS messages in the article below:
About iMessage and SMS/MMS - Apple Support
If you meet all of these requirements, then this may simply be a network issue. Try to send the message when connected to Wi-Fi. If you're already using Wi-Fi, test it on a different network, or when connected with a good cellular connection.
Thanks for using the Apple Support Communities. Cheers!