The Bucket can be purchased from Pitchfork Jeb's Farmer Supply. The Bucket is used to milk the cows that the player has purchased for their farm. To milk the cow, equip the bucket, then get close to the cow and left click. You will then have milk in your inventory.
It can also be used to obtain a Water Bottle, which is no longer used as of this writing (5/28/2021)