Identify the form you have (whole spice, ground spice, extract, or liqueur) and what you’re baking (cookie, cake, bread, or custard).
Pick the closest category from the table: ground star anise or fennel seed for the most direct flavor match.
Apply the listed ratio. For whole spices, crush or grind so the flavor disperses evenly in batter.
If your substitute is liquid or very potent (extract, liqueur, licorice root), reduce other liquids and start at the low end of the ratio.
Taste-adjust only after baking the first portion (or during mixing if your batter is thin) so you can tune next time.