The animals you find on a farm are collectively called livestock. Your herd of dairy goats are livestock, but your toy poodle is just a pet.
Livestock are distinguished from other animals by the fact that they're domesticated and raised for food or money — if you get wool, milk, meat, or eggs from animals, they're livestock. The word comes from the sense of stock that means "supply for future use" or "sum of money; from the 1500s, this word was also used to mean "movable property of a farm."