Most food in Minecraft is only used to relieve hunger. Some foods grant additional benefits like extra temporary Hearts, or negative effects like food poisoning. To get food, you can kill animals for meat or grow it from seeds. Meat can be cooked to fill more hunger bars per consumption. Food can also be used to restore Hearts of tamable animals like dogs and horses. Some foods can be used to make animals breed.
Farming
To farm, use a Hoe to plow a block of Dirt. To allow the seed grow, the Dirt block must be touching a Water source, whether beside it or below it. Plants need time to grow, but the process can be sped up with Bone Meal. Sugar Cane is an exception to the Hoe rule—it can be planted beside Water on either Dirt or Sand blocks. Pumpkins and Melons need one adjacent block available to grow over on.
• Wheat: Wheat is harvested after growing seeds.
• Beetroot: Beetroot is harvested after growing Beetroot Seeds.
• Potato: Potatoes are harvested from Potato crops.
• Carrot: Carrots are harvested from Carrot crops.
• Apple: Apples fall from destroyed Oak and Dark Oak Leaves.
• Melon: Melons are harvested by destroying a full Melon after Melon Seeds have grown.
• Pumpkin: Pumpkins are harvested by destroying a full Pumpkin after Pumpkin Seeds have grown.
• Sugar: Sugar is made from Sugar Cane.
Meat/Fish
Cooked meat and fish are some of the best—or THE best—food sources, if you don’t count Golden Carrots and Apples. Raw meat can be obtained from killing pigs, cows, chickens, sheep, and rabbits. This meat can be cooked in a Furnace, or you can use a flame to kill the animal and have it cooked on drop, whether you use a Flame Sword Enchantment or Flint and Steel. Caught fish can also be cooked. Rotten Flesh and Raw Chicken cause negative hunger effects, making the hunger bar deplete faster.
• Cooked Chicken: Cooked from Raw Chicken (dropped by chickens).
• Cooked Porkchop: Cooked from Raw Porkchop (dropped by pigs).
• Cooked Beef: Cooked from Raw Beef (dropped by cows).
• Cooked Mutton: Cooked from Raw Mutton (dropped by sheep).
• Cooked Rabbit: Cooked from Raw Rabbit (dropped by rabbits).
• Cooked Fish: Cooked from Raw Fish (fished for).
• Cooked Salmon: Cooked from Raw Salmon (fished for)