You can start a task, like sawing boards, and then activate a flask on your hotbar and continuously cut the log into boards. I believe you are meant to stop a task and then drink, and once stamina is full you restart the task.
Step 1)
Start cutting boards
Step 2)
Wait until stamina is low
Step 3)
Activate flask on your hotbar.