Hey xtal3,
When the iPhone randomly restarts, do you see a spinning gear on the screen? Also, how much storage do you have on your iPhone? You can locate this info by following these steps:
1. Go to Settings > General > [Device] Storage. You might see a list of recommendations for optimizing your device's storage, followed by a list of installed apps and the amount of storage each one uses.
2. Tap an app's name for more information about its storage. Cached data and temporary data might not be counted as usage.
How to check the storage on your iPhone and iPad
You can also use the article above to optimize your storage if you're running out of space.
Let's make sure that your iOS is updated to the latest version. Learn how to check this by following the steps here: Update your iPhone or iPad
We hope this helps!
Best regards.