Hello there,
If your device is unexpectedly restarting before it allows you to do anything, it could very well be related to low storage capacity. I would recommend first trying to restore your device using a Mac or Windows PC and set it up as new.
Here is a link that can show you how to restore your iPhone: https://support.apple.com/en-us/HT201252
If your issue persists after setting up as new, then your issue will be hardware related and may need some repair. If you have AppleCare+, you’ll want to get in contact with Apple for support.
If have insurance with your cellular service provider, you’ll want to contact them for further service instructions.
If you do not have any type of insurance or warranty on your iPhone, you can still contact Apple to have them run diagnostics on your device. From what I understand, they don’t charge unless you decide to proceed with a repair or replacement.
Hope this helps!