You can customize lock screen security on Android by going to Settings, choosing Security, and then Screen lock. Meanwhile, from the Settings app on iOS, choose either Touch ID & Passcode or Face ID & Password depending on which biometric security method is built into your iPhone.
You should also make sure the screen on your device locks as soon as possible after you’ve stopped using it—otherwise someone could surreptitiously swipe it while you’re not looking, before the locking mechanism kicks in. On Android, open Settings, then go to Display, Advanced, and Screen timeout to set how quickly the screen should turn off. Over in iOS settings, pick Display & Brightness, then Auto-Lock. The shorter the time period you set here, the more secure your data is.
If you need to lend your phone to someone, but still worry about their unfettered access to your handset, know that you can lock people inside one particular app or prevent them from installing anything while you’re not looking. We’ve gone deeper into these features and other similar security options, for both Android and iOS.