Coffee starts with an acorn, and there are two ways to get one.
You can buy an acorn from Costolots' store, or grow an oak tree and wait for the acorns to drop. Either route works, and the second is free if you have the space and the patience.
Once you have one, open the menu and select Bart Tinkers' shop. Choose the gold tinker on the right-hand side of the screen, then select your acorn or acorns. After Bart has finished tinkering them, the coffee will be waiting for you.