If I'm going for a longer hike I try to have a banana for breakfast before I head out and one at the end of the day to prevent electrolyte imbalance beforehand and to aid in recovery afterwards. This is especially true when the weather is warmer or dryer and I know I'm going to sweat more. If it's really warm/dry I will do the electrolyte tabs and prefer the Nuun ones the best myself.
As a reminder, make sure you take sips of water even as you're just getting going and not wait until you're feeling thirsty. If you're starting to get thirsty you've already waited too long.