Facebook malware

How does it works, how to protect yourself against it and what to do if you get infected?