Spices like star anise have a special place in Indian cuisine mostly due to the varied, exotic tastes that they bring to the food, but these spices do a lot more than just impart taste to your food. They have many biologically active compounds and hence can be widely used as natural remedies to treat many conditions.
Star anise is known for its earthen, woody flavor and is used in cooking biryani and some curries. It has a variety of health benefits like improving digestion, treats cold and flu and more. In Chinese medicine, star anise is also used to boost milk production in lactating mothers. A study published in the Journal Natural Production Communications says that star anise contains a compound called anethole  which is responsible for its typical odour. Anethole mimics the activity of estrogen  and hence is an effective galactagogue which means it boosts milk production in lactating mothers.
You can drink a cup of herbal tea made with star anise. To a cup of boiling water add a star anise flower. Reduce the water by half, strain and drink. The
Remember that this is just a home remedy and might not be as safe as it sounds. There have been a few reports where mothers consuming herbal tea made from star anise and other galactagogues reported restlessness and vomiting in their infants. On hospitalisation, it was found that the infants suffered from hypotonia, lethargy, emesis, weak cry and weak response to a strong stimulus. However, the study couldn t prove the association between star anise and this behaviour. 
You may like to read
Hence, it is best to ask your doctor to prescribe a galactagogue that stimulates milk production.
1. Hasegaw T, Seimiya H, Fujihara T, Fujiwara N, Yamada H. Aroma profile of star anise and the structure-odor relationship of anethole. Nat Prod Commun. 2014 Feb;9(2):251-6. PubMed PMID: 24689303.
2. Penagos Tabares F, Bedoya Jaramillo JV, Ruiz-Cort s ZT. Pharmacological Overview of Galactogogues. Veterinary Medicine International. 2014;2014:602894. doi:10.1155/2014/602894.
3. Rosti L, Nardini A, Bettinelli ME, Rosti D. Toxic effects of a herbal teamixture in two newborns. Acta Paediatr. 1994 Jun;83(6):683. PubMed PMID: 7919774.