Prevent malware infection by downloading software only from its licensed distributor. Avoid ready-made installation images or virtual disk images, as they may contain malware.