With the "Reply With Message" function, you can respond to a caller with a text message when you're unable to answer the phone.
When you receive a call, you should see a phone icon next to the green Answer button. Swipe up on that icon and select "Reply With Message." You'll see a list of three messages, one of which you can choose to instantly send to the caller. There's also an option for you to create a custom message at the time of the call. While you send the text message, the caller is directed to voice mail.
To personalize a pre-written message, go to Settings > Phone > Reply With Message. You can replace any of the listed messages with one of your own, as in the image on the left.