Add oil to the pan.
Roughly chop the garlic, ginger, and chili.
Add them to the pan on medium-high heat.
Cook for a couple of minutes; they don't need to get color, just soften a bit.
Add brown sugar and soy sauce and stir well.
Add 1 cinnamon stick.
If you have a small amount of meat you want to use your sticky sauce for, you don't need to make a larger amount. We have a lot of meat here, so we add water to get a bit more sauce.
Turn down the heat so it simmers gently.
Add star anise, cloves, and lime juice. Let it simmer for a couple of minutes.
Mix water and corn starch in a small bowl.
Make sure the sticky sauce is boiling (turn up the heat if necessary) and add a bit of the thickening mixture. Add more until it has thickened well.
Let it simmer for a couple more minutes.
Taste the sauce and adjust with more lime juice, chili, or ginger if needed.
It's up to you whether to remove the whole spices or not - just don't eat them.