Hello suntale.
Thank you for using Apple Support Communities. It sounds like you're experiencing issues with your iPhone unexpectedly restarting on you. You also mentioned that you're getting prompted that your battery requires service. If this is the case, you most likely need to have your iPhone physically evaluated for battery service. The following resource has more details on that specific message you're seeing:
If you see 'Your iPhone battery may need to be serviced' - Apple Support
From here, reaching out to Apple Support would be the next best step to take. You can reach them by using the link below:
Get Support
Thank you for using Apple Support Communities. Best of luck.