By default iOS shows new messages as a dropdown at the top of the screen if the phone isn’t locked or in sleep mode. This appears for only a few seconds before disappearing. Because I have two-factor authentication enabled, it’s not unusual for me to want to have these messages stick around a little longer while I type the code into another device, or my Mac. I could just open the Messages app, I guess, but that’s a lot of tapping :-(
The solution is simple. Just drag down the notification. This will open the quick reply field too, but you haven’t got to use it, and the notification now won’t disappear until you get rid of it by dragging it up, or by tapping on the screen/switching apps.