From this support document, Use Messages on your iPhone, iPad, or iPod touch - Apple Support
Reply from the Lock screen
- From the Lock screen, touch and hold the notification that you want to reply to. Or depending on your device, you might need to swipe left over the notification and tap View.*
- Type your message.
- Tap
to send.
If you have an iPhone X or later, or an iPad with Face ID, and can't reply to a message from the Lock screen, go to Settings > Face ID & Passcode, and turn on Reply With Message. If you have an iPhone SE (2nd generation), iPhone 8 or earlier, or an iPad, go to Settings > Touch ID & Passcode > Allow Access When Locked, and turn on Reply with Message.
* Touch and hold is available on most devices that support iOS 13 or iPadOS. On iPhone SE (2nd generation), you'll need to swipe left on the notification, then tap View to reply to a message from the Lock screen.
Learn how to manage Messages notifications from the Lock screen.