So there seems to be a bit of confusion on this topic but it is essentially quite simple (at least compared to irony versus coincidence, which is a highly subjective topic).
Sarcasm is a subcategory of irony. That’s the first thing you need to know and it makes a lot of sense when you understand this. The similarity comes from the root of the definition of irony – a subversion of expectations. Basically, anything said or done, or an event that occurs, which goes against expectations. Like if I set fire to a haystack and the wind blew the cinders on to my neighbour’s house, setting it on fire instead. I wasn’t expecting that to happen so it’s ironic. I could layer this irony with another level by adding some context – say that we were burning the haystack because it was a fire hazard to our houses. Irony can be verbal, situational or dramatic. The first two are self-explanatory. As for dramatic irony, that’s actual a technique often used by playwrights in which the audience knows a certain fact but the characters don’t. This can be applied to real life though is a stronger tool in literary texts.
Anyway, sarcasm is similar in that you are saying something that goes against expectations. There’s two key differences with sarcasm though; first of all, sarcasm can only be verbal (whereas irony can be situational or dramatic). Secondly, sarcasm is designed as an attack. Irony can be innocent but sarcasm is used with the intent to mock or hurt somebody. The degree to which you are doing this can vary. Friends can be sarcastic with each other because friendship can withstand a bit of good-natured barbing, but again, there is an intent to single out a person or persons and ridicule them when it comes to sarcasm.
As for the whole irony and coincidence debate, I remember the Oatmeal did a good post on it. The gist of it is anything coincidental can arguably be ironic because it is subjective on the observer’s expectations. Since irony is a subversion of expectations, anyone could argue that any coincidence is ironic to them. The only thing I would add to this is that people do use the word “ironic” too frivolously, and there are times where if you consider a coincidence ironic, it really just shows that you’re stupid.