How can I turn off a frozen iPhone?
The first thing that you can try is doing a hard shutdown by holding both the power button and the home button for at least ten seconds. If your device still does not turn on or respond, you can try putting it into DFU Mode (recovery mode). To do this, start by plugging your device into your computer with the USB cable. Then hold the power button for around 5 seconds. While you are still holding the power button, press and hold the home button for an additional 10 seconds. At this time, release the power button but keep holding the home button for around 15 seconds. At this point, iTunes should recognize your phone as a device in recovery mode. To exit recovery mode, hold the power button and the home buttons until the device begins booting.