To protect against both spyware and adware attack you can install antivirus, update software, and avoid suspicious downloads.