Competent use, including most of all frequent updates to necessary items. Jailbreaking phones, downloading legitimate (or legitimate appearing) apps from sketchy sites, downloading porn (honestly an easy way to add unwanted files to your machine) will get your system off in no time.
Computer ailments are like human ailments--they can't be prevented. But as you can be a healthy person and recover quickly, you can be a healthy user with good preventative/recovery measures for your devices. No single service prevents malware any more than any single physician prevents illness (and if you find someone promising the latter, get a new physician).