You can power off iPhone from the Settings app

The usual way to power off your iPhone is to press and hold the Side button for few seconds until you see the prompt to “slide to power off”.

In iOS 11, Apple added a new entry to the Settings app to allow you to trigger the above “slide to power off” screen. Go to Settings > General and scroll all the way to the bottom and tap the “Shut Down” item.

So now you know how to turn off your iPhone when the Side button is not functioning.