I've done 165 centuries (100 miles) or longer rides. Some lots longer.
This is what works for me.
Nutrition
Food: aim to consume 200-300 calories per hour. Yeah, sure, there are people who can ride long distances on next to nothing. But start with 200-300 calories per hour. Then experiment. Find out what works for you. Find out how many calories you feel comfortable with. Find out what foods you feel comfortable eating.
These days, we like these ... I especially like the Choc Apricot Coconut & Cashew.
Tasti - Nut Bars
Hydration: aim to consume one 750 ml bottle of water and/or sports drink (your choice ... personally, I like water these days) every 1 to 1.5 hours. The amount will depend on wind, exertion, heat, and several other things. But that's a good starting point.
Electrolytes: sports drinks will have some electrolytes, but probably not enough. I prefer to get my electrolytes from a combination of food and electrolyte pills. Salted almonds are high in most of the electrolytes. Plus they have calories. And they are available in packets in many convenience stores. Get a small packet mid-ride and wash it down with orange juice (more electrolytes + calories). Potato chips are also quite high in electrolytes. They go down well with sweet iced tea which has a bit of potassium in it (one of the electrolytes).