From PinataIsland.info, the Viva Piñata wiki
The trick stick is a tool introduced in Trouble in Paradise used to teach tricks to your piñatas. Each species can learn two unique tricks. The first trick involves them doing something themselves, while the second trick always involves them using an object. To teach tricks, simply scan a learn trick card, or feed the pinata the item needed and poke the pinata with the trick stick when a green circle appears.
Once a pinata has learned a trick, players can use the trick stick (or a perform trick card) to get that pinata to perform a trick.
Players can also take advantage of trick stick cards that will enable them to change the appearance of their trick stick.
Using the trick stick on a cocoon will instantly free the piñata inside. Poking () the cocoon causes the piñata to stay at its current size permanently. You can poke it before, during, or after the cocoon grows to have a permanently small, medium, or large adult piñata. (Mini Pinatas)