To do this,
1. Open iPhone “Settings”.
2. Go to “Accessibility”.
3. Select “Voice Control”.
After that, being near the phone, you can say "Lock screen".
As a result, the person who takes possession of your phone will not be able to do anything with it, since the smartphone unlock window will be displayed.