First, try a hard reset by quickly pressing and releasing the volume up button, then the volume down button, and finally holding the side button until you see the Apple logo. If that doesnt work, check for software updates. If problems persist after updating, consider restoring your iPhone to factory settings.