This is easiest when done in local multiplayer. See "Count of Carcassonne" on how to set this up. To get 30 points, you need to have 10 cities supplied by farmers (3 for each city). Keep in mind, a city can be supplied by more than one farm, as long as they have their own separate fields. Focus on building lots of small cities, as opposed to bigger ones, as a city is worth the same for farming, no matter its size. This will unlock at the end of the game after the scoring.
See THIS link for more complete information about farm scoring.