This article explains how to lock apps on an iPhone running iOS 12 and later. Information about workarounds is also included.
How to LOCK apps on your iPhone! (with Face ID and passcode)
In iOS 12 and later, you can lock first-party apps with Screen Time, a feature introduced in iOS 12.
Go to Screen Time > Content & Privacy Restrictions.
Turn off the switches (tap to make the switch white) for apps you don't want to use.