Unexpected shutdowns often happen when your iPhone battery is unable to deliver power consistently. To recalibrate your iPhone, fully charge it and then use it until it shuts down due to low battery. Connect it to a charger and let it charge to 100% without interruption. This can help recalibrate the battery gauge in your device.