Mouse moving vertically up and down, as well as clicking, on its own
A couple of suggestions to get you going…

Disconnect it from the network [not just the internet]. Reboot.

Disable any Automator actions ~/Library/Automator [perhaps zip them, then delete, as there can be many in there for legitimate reasons]. Reboot.

Repeat 2 with anything in ~/Library/Services &amp; ~/Library/Scripts &amp; also see if you have a folder in ~/Library/ called QuicKeys.

Install &amp; run Malwarebytes.


Report back…