You can check if your Mac is infected with malware by opening the Activity Monitors. To do this, open a Finder window and head to the Applications tab from the menu on the left side. Click on the Utilities folder and open Activity Monitor. Click on the CPU tab and select the % CPU column to organize the processes from high to low. Check for applications or processes that use a large chunk of the CPU power. If you find anything suspicious, copy the name and paste it on Google to check whether it is some sort of malware.