Food
You need calories. If you are riding over 30 miles, you should be drinking some sort of "Gatorade". You need calories and you need electrolytes.
Your muscles have enough energy for about 2 hours of light to moderate exercise. Beyond this the muscles run out of their fuel: glycogen. The muscles still need food, so they pull glucose (dextrose mixed with water) from your bloodstream. That's the fuel intended for your brain! If you keep exercising, this leads to low blood sugar. You feel tired. If it becomes bad enough, you will become dizzy and can actually pass out! In biking, this is called "bonking".
Put the calories back in! Fruits and carbohydrate foods are very good. They contain easy to digest sugars which your body can use right away. Some people like protein. I personally stay away from protein while riding; I think it interferes with the absorbing of fluids and carbohydrates. Fats can cause similar issues.
What to eat? Bananas are nearly perfect. Power gels are great. Power bars, shot blocks, sport beans, etc. All have calories. JAT Fuel is electrolytes and super easy to absorb simple sugars.
How much should you eat? If you aren't bonking, you're eating enough. You can also use a calorie meter from a bike computer. These vary widely on how they calculate calories burned, and you don't need to put back every single calorie. Unlike hydration, this is no simple way. If you aren't bonking you're doing OK. If you are getting tired, try more!
On the MS150, over 5 hours, I use 8 oz of power gel or about 800 calories. I also drink 6-7 bottles of fluid at about 100 calories each. So I consume something like ~1500 calories over 5 hours. YOU need to work out what your body needs.