First, you need a sample.
The mercantile store gives out free paper bags.
Use a paper bag on the rear end of a horse for your sample.
Timing is a little tricky; you may have to try to get a sample several times before the game will say that you're able to.