Iphone 7 wont turn on
There might be an issue with your phone's battery. Check out Apple's iPhone Battery and Performance page and scroll down to the &quot;Preventing unexpected shutdowns&quot; section. They have a very detailed explanation of various factors that contribute to unexpected shutdowns.
If your phone is unexpectedly turning off even whilst connected to an AC power supply, then there might be an issue with your phone's hardware and you should contact some technical support for further help and inquiries.
If there's absolutely nothing wrong with your phone's battery or other hardware, then it might be some app or other piece of software that's causing the issue, and you should most probably do a complete factory reset of your phone. It's definitely not an iOS software bug, that much I can tell you.