The iPhone may seem completely secure when locked, but some items can still be viewed – including Notification Center, which may contain private information. In addition, it may still be possible to access Siri or to send messages even when the device is locked.
To limit what can be accessed, open Settings and select Touch ID & Passcode or Face ID & Passcode. Enter your passcode and scroll down to the Allow Access When Locked section. From here you can turn off any option that you don’t want accessible when your device is locked.