If you exercise for an hour or less, water is all you need to stay hydrated. But if you go for longer, you need to replace electrolytes. These are minerals, such as sodium, potassium, and magnesium, that help you stay hydrated. You lose them when you sweat. Look for a drink that has electrolytes, like a sports beverage or coconut water.