This was on the internet if you are on iOS -
They weren't primarily intended for securing apps, but they can do the same job. The first is Screen Time, which you can access from Settings: If you tap Use Screen Time Passcode to set a passcode, then select App Limits and set the daily limit for an app to zero hours zero minutes, you're effectively locking other people out of the app without the passcode.