He wasn’t actually shown drinking it in the Marvel comic.
But Spaceballs did.
There could easily be a small reservoir inside the mask allowing Vader to take a small sip, which he would then drink via a straw type mechanism, (astronauts have been able to drink while in suit since the 60’s) but I don’t think they had actually figured out how what Vader actually was like behind the mask before the sequels.
The business with Force levitating the cup was also in the novel.