Take a wide, heat-proof bowl, preferably steel, stoneware, or any other bowl that does not break while pouring the hot oil.
Combine chilli flakes, garlic, powder, salt, and sugar in a heat-proof bowl.
In a saucepan, add oil, whole spices, and ginger slices—heat oil to 180 degrees F (approx 80 degrees C). In simpler words, the oil should be ready for deep frying, and the aroma of spices should release. Ensure it is not fuming or smoking, or chilli flakes will burn.
Remove the whole spices from the hot oil using a slotted spoon or a pair of tongs. You can also filter the oil to get rid of whole spices. You can leave the black peppercorns in the oil itself.
Carefully and cautiously pour the hot oil over the chilli mix in a heat-proof bowl. Keep the bowl at a safe distance from your eyes.
Mix the chilli oil with a big spoon. Once it cools down a bit, add lemon zest and juice. Mix one last time and allow it to cool completely.
Store chilli oil in an airtight container or use it right away.