My device got an problem since one months ago....In that situation i can't restart the phone manually and also cant by pressing buttons....
System Crashing on IOS XS MAX
It only works when the battery got down and then charging.
This is not a developer issue; it's a hardware issue. These forums are for asking development questions, code etc., not product support.
Go to the Apple Support Forums or an Apple Store with your device.