Sometimes, when the reaction or sickness happens immediately after eating or drinking, you just know.
However, that is not always the case. Food poisoning and allergy symptoms can emerge hours or even days after consuming dangerous food or drinks. You might not always know exactly which food you consumed during that period caused your symptoms. It can also sometimes seem unclear whether your symptoms owe their cause to food poisoning or other factors such as, for example, being pregnant or contracting a non-food-related virus like the flu.
The best and safest way to find out if food made you sick is to visit a doctor to treat your symptoms and to discuss their potential cause. A physician may have suggestions for figuring out which food or ingredient, specifically, made you ill. It may also help to contact others who shared the meal with you, or who you know ate the same food, to find out if they suffered similar ill-effects. Finally, watch the news. Health agencies will usually go to the press immediately to alert the public to a potential outbreak of a food-borne illness.