In addition to the other answers here, I would like to stress the importance of cooking.
Lifeforms produce poison to protect themselves. Often, poison is made of proteins, because proteins are easily able to react with cells. Cooking degenerates proteins, meaning that the poison will lose its function. Indeed if you cook most poisons, they are likely to become harmless [citation needed].
At the same time, it is unlikely that cooking will produce new poisonous material. [source: biochemical student] This could happen if the cooking process splits up complexes which are comprised of poisonous parts.
Still note, that in general, there is no way to tell if food can be eaten. For instance, we cannot even tell if an unknown (earthly) mushroom is ediblewe cannot even tell if an unknown (earthly) mushroom is edible. I was merely pointing out a way to slightly reduce the danger.