Farming Sheep, Cows and Pigs in Minecraft
Farming cows and pigs will provide a ready source of meat for food. Cows also provide leather, which can be made into armour, and is essential for crafting books. Cows can be milked by right-clicking on them whilst holding a bucket.
Sheep provide wool, but nothing to eat. Pigs can also be ridden.
The same techniques also apply to chickens, but they also lay eggs, which is an easier way to increase their numbers. You can farm chickens the same way as other animals (see the basic tutorial), but you might want to use an improved farm design that collects the eggs for you.
What you will need
The essential thing you will need for farming is food for the animals. Get some of that before you start!
Cows and sheep eat wheat. Pigs eat carrots. Chickens eat seeds (most easily obtained from wheat or long grass, but they will eat any kind of seed).
How to build the farm
Build an enclosure
First you will want to build an enclosure, either a small pen or a large field, in which to keep your animals. This can be indoors or outdoors, but it needs to be somewhere that you can lead the animals to, so outdoors is easier. If you're raising sheep for wool, you will need a large grass floor so that they can eat and regrow their wool.
Fences and Gates
Fences form a barrier that is 1½ blocks high, so that mobs (or players) can't jump over it. Fences are crafted from wooden sticks, and automatically connect together when placed next to each other. Gates act as a way to get through fences, and are opened or closed with a right-click.
An alternative to gates is to place a block of dirt one block away from the fence, so that you can jump out of the field.
You can just fence off an area and build a gate to get in and out, but if you build so that the ground is higher on the inside than the outside, then you can make an animal pen that is easy to get into from any direction.
Find some animals
Find some animals: you will need two of the same kind to breed. There are no males and females in Minecraft. Hold some of their favourite food out (wheat for sheep and cows; carrots for pigs; seeds for chickens)
When they notice the food, they will look at you and follow you. Lead them back to their new home!
If you built the kind of pen suggested above, it will be easy to get them to follow you in.
To get your animals to breed, you just need to feed them. Right-click on an animal whilst holding wheat, and hearts will appear above its head so show that it's in the mood. Right-click on another animal nearby, and, well, nature will take its course.
Next something complicated to do with birds and bees and storks and cabbage-patches will happen. Mercifully we don't need to know about all that, we just get to see the results. Awwww!
Until the baby grows up, the adults will not respond to further attempts to make them breed. However, pretty soon you will have four animals that can be bred, and you will quickly be able to raise a large herd.
The most efficient way to harvest meat from your cows and pigs is just to enter the pen, equip a sword and slay all of them except a few that you save for breeding the next herd. If you kill pigs by setting them on fire, then your pork chops will be ready-cooked, but you will have to live with the knowledge that you are a horrible person.
Sheep will drop one block of wool if you kill them, but they will drop more if you right click them with shears. Sheep will regrow wool after shearing, if they have grass to eat, so you can get lots of wool over time.
If you want coloured wool, you can dye the sheep first for greater efficiency. After shearing, the wool will grow back the same colour you dyed it. You can, of course, dye coloured sheep white with bonemeal.
If you breed coloured sheep together, the babies will be the same colour as one of the parents, not a mix.