"What is a trojan?"
A trojan, officially is a malware that can record any type of password. The trojan horse can remember a password, then it may change the password to a random one that only the horse knows (Some trojan horses). Then the horse can access your credit card number, IP address or Apple ID. These are just tiny bits, not harmful at all. But if a trojan horse access your signature, it may get your money.
How to prevent it
Some downloads contain viruses or attachments in them. Run an anti-virus scan before you use the download.
Some exploits that give you cheats contain trojans. They're mostly safe, but often mistakable.