A few questions, if I may:
- How do you know that you were infected with malware?
- Were there specific symptoms?
- How did you try to remove the malware?
- Were you able to identify the malware?
- Have you tried booting into Safe Mode to see if the same symptoms persist?
To boot into Safe Mode, do the following:
- Shut down your Mac.
- Reboot your Mac and immediately hold down the Shift key until you see the Apple logo on your screen.
- Bear in mind that booting in Safe Mode is a bit slow.
- Try running Safari in Safe Mode and see if the same problem persists.
You should also boot your Mac in Recovery Mode and run Disk Utility to see if it discovers and fixes anything.
If the problem persists, you may also want to zap your PRAM, so that your system is restored to its default settings. If you need help with this, let me know, and I will be happy to assist you.
Finally, you may want to reset the SMC. Again, I can help you with this if you don't know how to do it.
If worse comes to worst, you may have to reinstall Mojave, either from a Time Machine backup, or from some other backup, or by going into Recovery Mode, unless you have the full 6 GB installer app on hand.
Let me know how it goes. Thanks.