Virus on Mac. Can't boot, please help!
I have an apple mac pro 2013, 1tb SSD, 64gb RAM with Monteray OSX. Everything was working fine, I have 2 different antivirus softwares which found a few files (looked like malware), these were deleted however since then my web browser flagged every website as phishing. I turned off the internet and then a system monitor flagged that some random files were trying to sign applications (I terminated them from being allowed), I found the folders they were coming from and found that they contained word lists (the kind used for brute-force password attacks) amongst other unknown files. I deleted them and then I was constantly baraged with 'allow access' 'confirm username and password' on anything i then clicked on. I didn't enter any credentials and shut the machine down.
Since I've turned all routers off in my house and tried booting to the 2nd partition that has a different fresh copy of OSX installed, however every time i start the machine it comes up with "This machine needs restarting" and tries to boot to the infected partition instead but gets half way on the loading bar then stops. Whats the best thing to do? I don't particularly want to lose all my files for work etc however I'm more than happy to reinstall OSX providing I can actually do so.
Also if i can reinstall will this virus be on the RAM and infect it again?
Any help is hugely appreciated
MacBook Pro