Avoiding foods you are allergic to is generally the best way to prevent an allergic reaction. Oral immunotherapy can also be helpful in reducing the severity of allergic reactions and the risk of accidental exposure.