Coffee is consumed in the same way as other forms of food. Selecting it brings up a menu on the Blockhead with their energy bar and buttons to use or cancel.
When coffee is consumed, an empty cup is returned to that Blockhead's inventory, their energy bar is fully restored (even if it had been empty), and there is a slight increase in their hunger bar. Starting in version 1.4, the energy bar will also turn golden. In addition, a Blockhead who has consumed coffee will temporarily be accelerated in its actions, such as mining with a pickaxe, walking, etc.