So there are no hard and fast rules as to what to eat before a race. There are a few tips that you definitely want to consider. Stop eating solid food about an hour before. Other than that, you want to eat a nice mix of carbs, vegetables, fruit, protein. Choose whatever you know you enjoy that doesn't upset your stomach. Never try anything new.
Pasta's always nice, not too much heavy red meat. In the morning, my favorites would be yogurt, granola, eggs, and a banana. A lot of cyclists enjoy drinking coffee before a race. The lead-up, the final hour, it's encouraged to eat a gel or a shot block right before the race, but you definitely want to avoid eating solid food in the lead-up to the race. Another good idea is to be consistently drinking water. You don't want to be coming into this race dehydrated. In the hours leading up, you want to be constantly drinking Gatorade or Heed or anything with electrolytes or just plain water.
If you eat too much right before a race, you're likely going to feel really lethargic, and if you end up going too hard in the race, you're probably going to throw up. The reason you want to properly eat before a race is to make sure you don't bonk. Bonking essentially means you've hit a wall. You have zero energy, and you can't race anymore. Sometimes what you eat before a race can make or break your performance.