Your voice needs to be well hydrated to work well. That's because when your vocal folds (cords) vibrate together, there's a mucosal membrane layer on the outer edges of your folds that's making sound possible. If you're not well hydrated, your voice has to work much harder and you may strain, or even hurt your voice.
To stay hydrated, drink sips of non-caffeinated beverages throughout the day, ideally room temperature or warm. You can't hydrate your voice right before you sing because your voice is the gateway to your lungs. Instead, when your whole body is hydrated, your voice is, too.