If you want to stay safe on IRC there are 4 rules to follow:
1.) Don't download files from people you don't know/trust
2.) Don't click every link you see
3.) Don't type everything someone tells you, e.g. things like "Type $decode(........) to stop spam!" Pretty much, any time someone tells you to type something that contains $decode you should NOT do it.
4.) Don't give out information about yourself to people you don't know/trust.
If you follow those rules, you'll be pretty much safe. Of course other things can help as well, like having a good virus scanner and firewall.