can be naturally found in Jungle Biomes
. Here is a tutorial to help you farm them.
Step 1: Gather some cocoa beans and some Jungle wood
Step 2: Put the cocoa beans on the Jungle wood, most effieciently in a room under/next to your house
Step 3: Harvest them when fully grown
Step 4: Get the beans
Keep planting and replacing the beans. This should get you lots of cocoa beans. If you combine them with wheat (Tutorial for Wheat Farming here), you can get lots of cookies.
Note: You can make this smaller if you like