As a spice, the dried seeds are ground for use. Anise smells somewhat like star anise, fennel and liquorice. Anise is a strong spice, so use it sparingly. A few seeds, perhaps 10 at most, will improve the flavor of pizza sauce.
As a vegetable, the stalks are used. A typical use would be stir-fry.
The finely divided leaves can also be used to flavor a dish.