The main way malware miners spread these days is spam emails. Crooks disguise their messages as genuine notifications, attach the infected file, and victims eat the bait and get their computers infected. Thus, being very careful with emails, particularly their attachments, will help you avoid the miner malware.