step 0 is prevention:
- never download or install shady binaries that you don't know the source of and don't trust.
- always make sure you have real software by verifying their digital signature if possible
- if you have to run a shady application then use a sandbox so that in case it contained anything malicious it wouldn't infect your computer.
- never visit shady website
- and as the last line of defense if you are on a closed source OS such as Windows or Mac you can install a good anti virus.
if you are already infected
best solution would be formatting the hard disk and reinstalling the OS but since that is hard you can install a good anti virus or use a rescue disk to scan and try to remove it.
detecting this type of malware is easy since they have to use excessive amount of computing power so the symptoms are obviously increased CPU or GPU usage, hearing the fan sound (if your fan speed is adjusted according to usage),...
I would add script blocking, personally i use
uMatrix (from the maker of
uBlock origin) which is far better than noscript.
Don't let web sites run code without your explicit permission, one of such codes is for mining monero or similar cpu/gpu mining friendly altcoin while you are viewing a page. Yes, there are a few browser addons that are explicitly anti web-miners, but i think whitelisting sites is far safer than hoping the addon (or antivirus) is updated.
Big problem with malware is that on zero day, no one can detect it...
On cpu/gpu it is always good to constantly run fan/temperature monitors, i have these values shown realtime in my panel, along with ram usage etc. Any suspicious activity i immediately check running processes. I also catch misbehaving programs.
And if you are in a laptop or portable, blocking scripts happen to save battery too...