I fear I’ve just downloaded a Trojan…
Trojan horses that affect OS X are rare, but they do exist. Most, like the Flashback Trojan from 2012 (which masqueraded as an installer for Adobe Flash), work by enticing users to download a file. Another Trojan hit earlier this year, called OSX/ CoinThief; it posed as a tool to allow Bitcoin users to send and receive anonymous payments. Instead, it infected systems and stole Bitcoins from wallets.
To avoid inadvertently infecting your Mac with malware, don’t download anything unless you’re absolutely certain you know what it is. If you’re unsure, do a Google search as to whether there’s any current OS X malware out there.
If you suspect you’ve downloaded something nasty, run Software Update. Apple often issues patches that (in the case of Flashback) remove the malware.
If that doesn’t work, download a free anti-virus tool (such as Avast!). You can then use it to scan your hard drive for known malware and, if any is found, remove it. Avast! can also alert you when you click on a link that it thinks is unsafe. It displays a green tick next to results that it deems safe. By installing it you give yourself the best possible chance of avoiding downloading malware or visiting websites that host it.