If the screen of your iPhone is not automatically switching OFF, when it is not being used, you can find below the steps to fix the problem of iPhone Not Going in to Sleep Mode.
iPhone Won’t Go into Sleep Mode
By default, iPhone is set to automatically switch OFF its display and go into sleep mode after a certain period of inactivity. If this is not happening, you are likely to find your device suffering from poor battery life and requiring frequent charging.
The most common reason for iPhone not going in sleep mode is due to the Auto-Lock option being disabled or due to longer Auto-Lock period being selected on your device.
Apart from this, Raise to Wake feature, change or corruption in Settings and other reasons can prevent iPhone from going in sleep mode.
1. Change Auto-Lock Time on iPhone
Open Settings > go to Display & Brightness > Auto-Lock > select the Time after which you want the screen to Switch OFF, if your iPhone is not actively being used.
As you can see in the image above, iPhone allows you to choose from 30 Seconds, 1 Minute, 2 Minutes, 3 Minutes, 4 Minutes, 5 Minutes or Never.
2. Disable Raise to Wake
When Raise to Wake feature is enabled on iPhone, it can automatically switch on its display, as soon as it picked up. However, this feature can sometimes make iPhone stay awake, even while it is just being carried around.
3. Install Updates
Sometimes, the problem can be caused due an Update waiting to be installed on your device.
Go to Settings > General > Software Update > tap on Download and Install (Option appears only if an update is available).
4. Reset All Settings
If above solutions did not work, it is time to Reset All Settings on your device to original factory default settings and see if this helps in fixing the problem.
Go to Settings > General > Transfer or Reset iPhone > Reset > On the pop-up, select Reset All Settings option.
When prompted, enter your Lock Screen Password > On the confirmation pop-up, tap on Reset All Settings to confirm.
5. Force Restart iPhone
The process of Force Restarting iPhone is defined by Apple and it varies, depending on the model of your device.
iPhone 6s and below: Press and hold Power and Home buttons, until you see your device starting with Apple Logo.
iPhone 7, 7 Plus: Press and hold Power and Volume down buttons, until you see your iPhone starting with Apple Logo.
iPhone 8, 8 Plus: Press and release Volume up button > press and release Volume down button > after this press and hold the Power button, until you see your device starting with Apple Logo.
iPhone X & above: Press and release Volume up button > press and release Volume down button > press and hold the Power button (Side button), until you see your device starting with Apple Logo.
6. Try DFU Mode Restore
In case your iPhone is not vibrating due to corrupted Hardware Settings, you will have to perform a DFU Mode Restore to fix the problem.
The DFU Restore Process will erase both software and hardware settings on your iPhone and reinstall both operating system software and Firmware on your iPhone.