How to Restart or Power Off Your iPhone
https://support.apple.com/en-us/HT201559
Your iPhone works hard for you and it sometimes needs a break. If your iPhone is experiencing performance issues like lagging or unexpected behavior you should power it off and give it a much deserved reset. The article above will show you how to power down your device.
Sometimes extreme heat, extreme cold, or heavy stress on an iPhone processor can cause an unexpected shutdown. If after an unexpected shutdown the iPhone will not power on, is frozen, or unresponsive refer to this article https://support.apple.com/en-us/HT201412.