If your iPhone needs to be forcefully restarted because of a system hang or other problem try the below steps:
iPhone 8 and Newer
- Press and quickly release the volume up button
- Press and quickly release the volume down button
- Press and hold the side button
- When the Apple logo appears, release the side button

Applies to: iPhone 8 and Later, iOS 12 and Later
iPhone 7
- Press and hold both the volume down button and the Sleep/Wake button at the same time
- When the Apple logo appears, release both buttons

Applies to: iPhone 7
iPhone 6S and Earlier
- Press and hold both the Sleep/Wake Button and the Home Button at the same time
- When the Apple logo appears, release the side button

Applies to: iPhone SE, iPhone 5S, iPhone 6, iPhone 6S
Sources:
- Face ID iPhone: Apple Support – Force restart iPhone
- Earlier iPhone: Apple Support – Force restart iPhone