Dirt, moisture, or oils on the screen can interfere with its electrical sensors.
Disconnect any Lightning cables or peripherals, as faulty chargers can occasionally interfere with the digitizer. Free Up Storage How Do I Fix An Unresponsive Iphone 11 Screen
Keep holding even when you see the "Slide to power off" slider. Dirt, moisture, or oils on the screen can