It's this kind of question that makes me think you are a genius or a troll!
I'll bite because I've only had to handle this as an AR in the last year so I would like to be corrected. And to be clear, I am talking about ad hoc drinking and not half way drinks breaks as explained in the LotG.
Firstly, if it's hot, get it in the pre-match - to the coaches and a reminder to the ARs. Agree on the likelihood of an extra half way drinks break and make it clear that ad hoc drinks have to be fast at long breaks in play.
And then on or off the pitch...? well, players should not leave the pitch but they shouldn't bring bottles on the field so there has to be a compromise. The only way AFAIK is that, during a long stoppage (injury, sub, goal, ball retrieval at a push) a player can go to the sideline, stay on the field, reach for a drink, take a drink, and get rid of the bottle before play restarts. AFAIK and have been taught it is important for the AR to keep an eye on any players drinking and make sure they jettison the bottles before play restarts, and they are on the field with no "objects".
That said, at grassroots hobby leagues you should take a much more lenient approach IMHO if it is really hot
Oh yeah and any GK that retrieves the ball and then reaches for a drink before taking a goal kick is getting an immediate warning from me - that's a d*** move in any league!