How to shut down your iPhone if your lock button doesn’t work
If your iPhone's sleep/wake button stops working, you can power it down with AssistiveTouch option. The iPhone only has two main buttons, the Lock (sleep/wake) button, and the Home button...