why does my phone keep restarting?

best answer
Debris in Ports. As you use your smartphone the USB port can sometimes get clogged with dirt lint or other things. So if your phone is restarting when it’s plugged for charging debris present in the charging USB port may be the cause. A compressed air can or a plastic toothpick can help you remove this debris.