The issue is food allergies can be both IgM mediated (meaning, immuno-globulin M) or IgE mediated. IgE ones are figured out with blood tests using radioactive tags, or a skin test (the one with needles). IgM are in your gut so there isn’t really a good way to test for IgM food allergies.
I guess you initially can form a guess that you are allergic to a particular item from experience. There are some allergies more typical than others, @marinelife sent a link to some of these, but you can be allergic to basically anything. The gold standard for IgM food allergy confirmation is an elimination-challange diet, but it can be a huge hassle for the patient and hard to discover direct correlation. For example, say one is allergic to wheat and milk, and an attempt to eliminate milk is made. Depending on how much wheat is eaten the 1–2 week period, you might assume milk wasn’t the problem, or that it was the only one, etc.
It’s possible to have IgE mediated alleriges but not IgM even to the same item. (Also vice versa). Thus a skin test might not show that you’re allergic to milk for example, but you may have a reaction when ingesting it. Also you could test positive for skin allergies but not show symptoms when eating.
There is controversy around a lot of food allergies even among allergy specialists (I got this info from an ENT friend that I called), though. Food allergies are a bit of a difficult subject.