Add the shallots, garlic, star anise, cardamom, and oil to a medium sauce pan and heat over medium-low heat. Cook, stirring occasionally until the garlic and shallots are lightly brown and crisp, about 15-20 minutes.
In a medium heatproof bowl, add the red pepper flakes, ginger, sugar, salt, and black pepper. Set a fine mesh sieve over the bowl and strain the oil into the bowl with the red pepper mixture.
Allow the garlic and shallot to cool in the sieve then add them to the chili mixture. Discard the star anise and cardamom pods.
Cool completely then store in an airtight container in the refrigerator for up to 1 month.
Video
Notes
Slicing shallot and garlic: Use a mandoline for easier slicing and uniform pieces.
You can use the chili crisp right away, but the flavors develop and intensify if you let it sit for a day or two.
Storage: Keep refrigerated in an airtight container for up to 1 month.