Cosmic irony is summed up effectively by describing a kind of pre-destined fate, often best illustrated by situations which we call Sod's law, or sometimes Murphy's law.
"Whatever can go wrong will go wrong, and at the worst possible time."
Most people will recognise this form as irony as the one most often used in informal speech, writing and media. As a consequence, it also happens to be the most often misused form or irony. It's pretty much akin to throwing one's arms in the air and shouting "The universe is against me!" Feel free to do that, by the way. The idea is that no matter how hard you try, at the worst possible occasion in which something could actually go wrong, it will, in the most unforeseen way, and with the most tragic circumstances. This is very much the idea behind Alanis Morissette's song "Ironic".
Sod's law (sometimes also referred to as Murphy's law) is exactly the Alanis Morissette situation. For example, the English will recognise the phenomenon of going on holiday to Spain (for the gorgeously hot weather) only for it to rain the whole time... and then when you get back find out it's been the hottest fortnight since records began.