How to Turn Off an iPhone When the Touchscreen Is Broken
If your iPhone's touchscreen cracks, breaks or otherwise becomes unusable, it prevents you from using most features of your device. If you want to save your battery while you wait for your touch screen to be repaired, turn your iPhone off. Doing so doesn't require use of your touchscreen at all, but rather two of the buttons elsewhere on your iPhone.
Place your left thumb on the "Home" button at the bottom of the iPhone screen. Place your right thumb on the button on top, right side of the iPhone.
Hold down the buttons until your iPhone's screen goes blank. Release your fingers immediately once the screen goes blank. If you don't, the iPhone restarts, rather than shuts down. If your touchscreen works at all, slide your finger across the "Slide to Power Off" bar to ensure the phone doesn't restart rather than shutting down.
Wait for your iPhone's battery to die if you can't get it to shut down using its buttons. Reputable technicians who repair your iPhone has access to a charger, so allowing your battery to die isn't inhibitive to fixing the problem.