Sometimes restoring the iPhone to the original settings can fix many problems. This will erase all data and settings on the phone (hope you have synchronized and backed up the previous data). Usually you sync iPhone and restore using iTunes but if iPhone doesn't turn on, try:
Step 1 : Plug one end of the iPhone USB cable into the Lightning / Dock Connector port, but do not plug in the computer.
Step 2 : Hold the iPhone's Home button (on iPhone 7, hold the volume button).
Step 3 : While holding the Home button, plug the other end of the USB cable into the computer.
Step 4 : This will open iTunes, put iPhone into Recovery mode and allow you to completely restore the iPhone.
In some cases, the iPhone may not turn on because it won't boot. This may happen after jailbreaking or when you try to install iOS updates without enough battery. If you are having this problem, please put your phone in DFU mode in this way:
Step 1 . Plug iPhone into the computer.
Step 2 . Press and hold the On / Off button for 3 seconds, then release the button.
Step 3 . Press and hold the On / Off button and the Home button (on iPhone 7, hold the volume button) together for about 10 seconds.
Step 4 . Release the On / Off button, but keep holding the Home button (on iPhone 7, hold the volume button) for about 5 seconds.
Step 5 . If the screen is still black and nothing appears, it means you are in DFU mode. Follow the on-screen instructions in iTunes.
Another but rare cause for the iPhone to not turn on is due to problems with proximity sensors, blurring the iPhone screen. This is because the screen is always dark even when the iPhone is on and not near your face. Follow the steps below to troubleshoot problems with proximity sensors
Step 1 . Hold the Home button and the On / Off button to restart the phone.
Step 2 . When the phone restarts, the screen will work.
Step 3 . Touch the Settings application .
Step 4 . Touch General.
Step 5 . Touch Reset .
Step 6 . Touch Reset All Settings to delete options and settings on iPhone but not delete data.
If you have applied the above solutions but still cannot fix the error. The last solution you can think of is contacting the Apple support center for assistance.
Refer to some of the following articles:
Good luck!