Pre-event meals should consist primarily of foods that can be easily digested such as carbohydrates and fluids. Examples of this includes toast, saltine crackers, low fiber cereals (think Special K or Rice Krispies) white rice, bananas, applesauce, eggs, sweet potato, chicken, salmon, and jello. Protein should be consumed only in small amounts, and fat intake should be very low to minimize the risk of gastrointestinal upset. I tell all my athletes to PRACTICE their nutrition regularly before the event and that way there will be less chance for stomach upset during the race.
3-4 hours before: Eat familiar foods-nothing out of the ordinary and easy to digest. If you are experiencing anxiety, break this meal up into 2 small meals. Examples- cereal (Rice Krispies) with almond milk, toast with jelly.
2 hours before the race- if you've already eaten 3-4 hours before the race then this meal is not necessary. No more than 2g of carbs per kg of body weight.
90-60 min before race: only liquid or semi solid fuel sources such as gels, chews or sports drinks. This because there isn't much time for solid foods to digest and you don't want to run the risk of gastrointestinal upset.
Within one hour of the race: No more than 30g of carbs
25-20 min before the start: it is ok to bring a gel to the start of the race- you can put this in your wetsuit and eat it before the gun goes off. It is best to take in liquids at this point so sipping a sports drink is fine as well.
High fiber foods and gas forming foods such as legumes, onions, cabbage, and fibrous cereals are not good choices as they may cause intestinal discomfort. Protein intake should be minimal.
Here's a chart that will help you break down the amounts of fluids, carbohydrates, protein, and sodium before race start. Obviously you want to stay away from proteins as this can cause gastrointestinal upset. Nutrition is just as important as the other disciplines and it is important to practice what works and doesn't work so that you feel confident going into race day.
Source: Ironman University