Press and hold the side button and either volume button until the power off slider appears
Drag the power off slider to the right
Wait for the iPhone to turn off
If the screen is unresponsive, press and quickly release volume up, then volume down, then hold the side button until the Apple logo appears, then use the slider when it appears
If your iPhone has a Home button, press and hold the side button or top button until the power off slider appears, then drag it to the right
