Generally, for plant-based foods, you can trust your nose. If it smells nasty, don't eat it. If it smells okay--just tastes different from what you expected, has gotten fizzy, etc., it's likely to be okay. This isn't 100% true, of course--botulism being the most notable exception. But botulinum grows in sealed containers, usually on alkaline substrates, and over a fairly long period of time.
Other considerations, in assessing whether something fermenting is edible or should be dumped:
Check to see whether it's gotten moldy (though not all molds are problematic--blue cheese. for example) or just bubbly. Molds have a higher chance of being problematic than do bacteria, though sometimes they can just be skimmed or cut off (with a good margin, since molds send out "roots" that aren't visible but will still taste bad).
The acidity of a food (fats are acids), as well as it's salinity, are also worth considering: more acidic or salty foods are less likely to support the growth of organisms that are harmful to people.
Did it ferment with exposure to air (at least initially) or in an airless environment (such as a factory sealed pouch or can)? The latter is much greater cause for concern. [NEVER eat food that made it's hermetically sealed packaging swell up (home canned items, factory cans/tetra paks/pouches)--that very well could be botulism.]
Will your accidentally fermented food get thoroughly cooked, such as going in a soup or cake batter? Sufficient cooking will kill most bacteria, though on rare occasion, even dead bacteria can cause harm.
If you're still not sure, and nothing in you wants to gag when you observe it (though even many gag-worthy fermented foods are happily eaten across the world, such as Japanese natto and, again, certain cheeses) carefully taste a tiny, tiny bit. Keep it on your tongue for at least 30 seconds and notice how your body responds.
Fermented coconut of all kinds (yogurt, kefir, water kefir) are popular, probiotic, health foods these days, so don't dismiss it out of hand--just learn how to observe it.
If you want to be prepared for next time, get a copy of one or both of Sandor Katz's books: Wild Fermentation (his first, in which he talks a lot more about his own experimentation) and his larger, more extensive and instructional volume, The Art of Fermentation.