1. Check your network connection. If you don't have good cell coverage or Wi-Fi service (assuming you use Wi-Fi calling) you won't be able to send messages, even if your phone is working fine.
2. Make sure you're not in Airplane Mode by swiping up from your iPhone and making sure the airplane icon in the upper-left corner is not enabled (highlighted orange).
3. Then, check your iPhone's Messages settings. In the Settings app, scroll to and tap Messages, then make sure the switches next to iMessage and Send as SMS are toggled on (to green).