I've bonked more times than I care to remember. Oh does it suck. Like running a 4 cylinder engine on 3 cylinders.
For me, it's a matter of making a point to eat ... anything, really ... and doing it continuously on the ride. Do not wait until you are hungry, then have a big meal, cuz if you do that, you get the double whammy of being out of energy and your body now needing resources not only to ride, but to digest the big meal as well.
Carry gels. Those are good for 40 minutes of energy or so (for me anyway), and are easily and quickly digested.
__________________
Proud parent of a happy inner child ...