The most common reasons why your iPhone won't turn off are:
It's frozen due to software problems.
The Side button is broken.
The screen is broken and isn't responding to taps.
You are not following the correct steps for turning it off.