Back in May 2017, Apple filed a patent application for a way to communicate with Siri by writing her questions and responses using iMessage. While that didn't make it into iOS, thankfully, something even better did — a way to ask Siri things with the keyboard directly in the Siri interface. This works in iOS 11 and iOS 12, and it will likely continue to work for future iOS versions.
Again, this will work with any iPhone running iOS 11 or higher, but there's one downfall to this: You can only do one or the other via the Home button or Side button shortcut — type or talk. For most of us, it's probably one or the other anyway, and you can still use "Hey, Siri" on supported devices to have verbal conversations either way.
To switch from voice to text only, just go to Settings –> General –> Accessibility –> Siri, then toggle on "Type to Siri." That's it. If you don't see "Siri" in the Accessibility options, then go to "Siri & Search" in the Settings app and make sure "Listen for 'Hey Siri'" or "Press Home for Siri" / "Press Side Button for Siri" is turned on.
While you no longer have to speak with "Type to Siri" on, Siri will still respond to you by voice if Voice Feedback is set to "Always On," though there will also be written responses and data cards. Of course, you can adjust your voice feedback setting in the same menu.
Now, when you want to ask Siri something via typing, just long-press your Home or Side button, depending on what iPhone model you have, and the Type to Siri interface will show up with the keyboard. Type out your question or command, then tap "Done" to get the response.
You can keep the conversation going by typing out another question or command. The only thing that sucks about Type to Siri is you can't use a third-party keyboard, just your default Apple one.
Really, the only thing that's missing from this "Text to Siri" feature is the ability to get responses without Siri interrupting music playback. If I'm typing and have my ring switch on silent, why does my music have to pause?!