Completely reinstall everything on Mac mini
Restart the machine, while holding ⌘ Command⌥ Option R. The option key gives you the latest supported version of macOS rather than what it shipped with. Then follow the prompts to reinstall a new macOS.

As long as you have a backup of your needed documents and settings I would also erase the drive with disk utility within the process of reinstalling, that will ensure nothing is left over from a potentially damaged OS install.