iOS users can press and hold the power and volume up button until the emergency call screen appears, then release. You now have to enter your PIN / Password to unlock again and not use TouchID / FaceID. Good luck trying to get me to tell you the code.
Everyone should just not use these methods to unlock their phones in the first place. Pressing a power button 5 times, or holding a power button for 10 seconds, or pressing and holding buttons until the emergency screen appears are very easy things to do, at least until there is a cop in your face grabbing your phone and putting you in cuffs.
Similarly, on Android there's an option in your lock screen settings along the lines of "Show lockdown option" that adds a lockdown button to the power/restart menu when holding the power button.
Or you can press the power button for like 10 seconds, that should force a restart and android asks for password/pin/unlock pattern after restart or after 48 hours.
iPhone SE also has that. It'll disable the fingerprint on next unlock if you hold the power button for 5 seconds or mash the power button repeatedly (like 5 times in 2 seconds, therabouts). Pretty handy to know these things not only for police but if you get mugged. Everyone should know how to lock their phone out