Question: How can I prevent anaphylaxis from occurring again?
Answer: The best way to prevent anaphylaxis is complete and careful avoidance of the foods that trigger anaphylaxis. That means not only avoiding any possible eating of the food where it's clear, but also when it might be hidden in other foods. Hidden either not-obvious because it's a small ingredient in a prepared food, or hidden because somebody else made the food and it's not clear that, for example, peanuts are in there.
Assuming that sometimes reactions occur because it's not always avoidable, then being prepared, having your EpiPen with you or epinephrine injector with you just in case of an accidental hidden exposure and reaction is important to prevent a severe reaction or an anaphylactic reaction. Some people say, "No epi, no eating."