Passcode.
If it is doing it when you are not accessing Keychain (passwords) or signing into this forum then backup and restore the phone from backup
Procedure.
First thing I advise is to try a Forced restart
Force restart iPhone – Apple Support (UK)
If no better you could Backup, restore to factory, then restore from the backup:-
If necessary set up without restoring backup and test at that point, erase again, then restore from the backup:-
(If the phone needs attention you will have to do this anyway)
If you can import your media to Photos or iTunes in a computer and copy important documents to a cloud server it will give you some resilience in case the restore from backup fails, or you need to ditch the backup and start as new.
See here for the resources you need. Allow a couple of hours:
How to back up your iPhone, iPad, and iPod touch - Apple Support
Restore your iPhone, iPad, or iPod to factory settings - Apple Support
Restore your iPhone, iPad, or iPod touch from a backup - Apple Support