Mac is acting weird all of a sudden
So apologies in advance but this might be long.
I first noticed something was strange when I realised Google kept logging me out on Safari. Every 10-15 minutes if I opened a new window or tab I would be logged out. I tried closing all the tabs I had open and logging in again and it still logs me out after a few minutes.
Next I keep getting a notification telling me my Microsoft exchange password is required but when I click continue it opens System Preferences but doesn't give me the box to enter my password.
Whenever I open System Preferences after closing it it defaults to the Sharing window where I was working two days ago.
I don't have any programs set to start automatically but when I restart my Mac, it opens all the programs I had open two days ago. Similarly all the Safari tabs I had open two days ago are there even though I've since closed them all.
When I drag any item to the bin it asks for my password.
System Preferences says I need to update my Apple ID settings but when I enter my password (which I know is correct because I used it to log in here) it says an unknown error occurred.
As best as I can tell I shouldn't have any viruses or malware as I have anti virus running constantly and a scan done before writing this didn't show any issues.
Does anyone know what could be causing these problems. I don't have a recent backup as I don't have enough external hard drive space and don't want to make a backup now with all these issues.
Thanks
iMac 27″, macOS 10.15