Chosen Solution
It’s working alright and out of the blue turns off. This happened multiple times.
Harshdeep Bagga there could be a multitude of reasons for it. Start with a new battery. If nothing else you will at least have a known-well starting point should further troubleshooting become necessary
If you are using a Mac, install Coconut Battery. It has an iOS button that will tell you your battery status when you plug your phone in via USB. https://coconut-flavour.com/coconutbatte…
Software problems can cause an iPhone to shutdown randomly. Try closing other apps and close any open tabs you might have open in safari/other browsers. If your iPhone’s storage is almost full, try deleting some info/apps off the device until you free up at least 10% of the total device storage. It is a good idea as well to back-up and reset the device software to rule out any additional software problems.