Work from cheapest fixes to deeper issues.
Lint in the Lightning or USB-C port blocks contact—gently clean with compressed air or a soft tool. Test multiple cables and bricks.
Force restart the phone. If it boots, check for debris and Settings → Battery options.
Very degraded batteries can behave oddly; see battery health explained and battery monitor.