I understand if this is too broad a question, but on the off-chance there is at least a broad category of problems anyone could point me to...
I've had a problem with the phone after asking a third party file managing app (FX File Explorer) to look for duplicate files (usually quite a long operation). It failed to complete, and since then nothing has been working on the phone and it keeps restarting. The weird thing is (or at least weird in my experience). It hasn't frozen or crashed. It's just that everything seems to be finding it hard to do anything. It's exactly the same in safe mode.
I turned on some developer tools (CPU indicator and notification for unresponsive apps). I don't really know what the CPU indicator is showing me (having no point of reference), but it spiked very quickly one time to cover almost the whole screen then calmed down to sit about a quarter along, so I'm presuming CPU usage is far from full. The unresponsive app notification is more telling as every minute or so a new app comes up with "... is not responding. Would you like to close it?". Basically everything is not responding.
I also tried checking running apps and cached processes, the third party app is not still running, just the usual set of background Google apps.
I can't do any USB debugging or software repair because "USB connectivity is not responding". I can't uninstall or re-install anything because "Settings is not responding" and "Google Play is not responding". I can't even use certain developer tools because many of those are "...not responding"
I realise this means I'm probably out of options, but before a factory reset (or the bin!) I'd just like to try and understand what could have happened. At least I could possibly avoid it next time.
Just to add - I've just done a Factory Reset. The problem is still there, apps don't respond, I can't uninstall anything, USB connection doesn't respond (or does respond but keeps dropping out) and after a while it will spontaneously restart. How on earth can one operation do this to a phone?