For iPhone X, XR, XS, or XS Max:
To power off the device, press and hold the Side button and either Volume button at the same time. When the overlay appears, swipe right on the slide to power off control.

For all other iPhones:
To power off the device, press and hold the Side button. When the overlay appears, swipe right on the slide to power off control.