Also note that not all issue with foods are caused by an allergic reaction. For example, people who are lactose intolerant do not have a allergic reaction to dairy, but their bodies cannot properly digest dairy so it causes them incredible distress.
If you suspect that you (or a loved one) has an issue with some food, then the best thing to do is eliminate the food from your diet for several weeks. If whatever issue you are having gets better, then that food is likely a problem. If you are not sure, then reintroduce the food and see if you have any adverse reactions.
Another idea is to keep a food diary where you list the types of food you ate in a given day and you also track whatever issues flair up on a daily basis. You can sometimes see patterns when you do this.
You can also do research to see which foods commonly cause issues or irritate whatever medical issue you are having. For example, there are foods that commonly trigger migraines. Not all people who get migraines are triggered by those foods and not all of those food trigger migraines in all people. But it will give you a starting point of which foods to take a closer look at.