Hi,
Since you’ve said this came out of the blue, there is a possibility it’s related to a software problem.
You can follow those easy steps to make sure it is or isn’t related to iOS:
Unlock your iPhone and once you’re on the Home Screen ;
Short-press (do not hold) volume up button and then short-press volume down (do not hold it either).
Then press and hold Power On/Sleep-Wake button and do not release it until the Apple logo appears.
That’s a software reset. It can be useful when iOS becomes unresponsive or freezes. It sometimes reset some data related to hardware which is why it could help with your issue.
If it didn’t prove to be effective, then you should make an appointment at the Genius Bar ;
You can either go to support.apple.com and provide your iPhone information or go to an Apple Store if there’s one near you and physically be present to the Genius Bar of the specific store.
They can have a first look at your phone and give you indications for what to do next.
If you need further assistance to go through the Apple support page, I’ll be of assistance ;