Wash the chili peppers thoroughly and drain well. Pat them dry with paper towels to remove any remaining water on the surface. Remove and discard the stems. If the peppers are large, cut them into sections.
Use a food processor to chop the peppers into fine pieces, stopping intermittently to check the texture. Avoid over-processing them into a paste. (see note 3).
Peel all the garlic cloves, then mince them in the food processor to a similar size as the chopped peppers.
Cut onion into slices.
Fry
Pour oil into a wok, skillet, or saucepan, and add the sliced onion. Fry over medium-low heat for about 5 minutes, or until the onion is lightly browned on the edges. Remove the onion from the oil using a slotted spoon or chopsticks.
Add the minced garlic and chili peppers to the oil and fry them gently. Keep the heat low, stirring occasionally. Use a spatula to scrape any garlic or pepper pieces clinging to the sides back into the oil to prevent burning.
This process takes about 25 minutes. Toward the end, you’ll notice the garlic and peppers have reduced in size, and there’s a clear separation between the oil and the solid bits.
Season
Mix chili flakes with soy sauce, then put the mixture into the wok. Gently stir for 30 seconds or so.
Add salt, sugar, and sesame oil, and give everything a final stir before turning off the heat.
Store
Let the chili oil cool completely. Transfer it to dry, clean jars or containers with an airtight seal.
Store the chili oil in the refrigerator for up to 2 months, or in the freezer for up to 6 months (see note 4). Always use a dry, clean spoon to scoop out the chili oil to prevent contamination.
Notes
1. Choose fresh chili peppers and chili flakes that match your tolerance to heat. Feel free to mix and match. More information on choosing chili peppers can be found in the post above. 2. The range of 3–5 heads of garlic (about 6 oz/180 g with skins on) is an estimate, as garlic heads can vary in size. If you’re unsure, you can weigh them, but there’s no need to be exact—slight variations in quantity won’t affect the final result.3. You can also use a mortar and pestle to mince the peppers and garlic, which works well for smaller batches.4. The storage duration may be reduced if moisture wasn’t thoroughly removed from the chili oil during cooking. Always check the oil’s appearance and smell before use to ensure its quality.