Pulverize ½ cup dried red chiles into little flakes in a food processor or spice grinder.
Smash ¼–⅓ cup roasted and salted soybeans into randomly-sized pieces.
Heat ¾ cup vegetable oil in a saucepan over medium-high heat.
Once the oil is hot, reduce heat to medium, add ½ cup minced dried onion or shallot and 2 tsp. salt, and cook until brown, about 3–5 minutes.
Add the chile flakes, soybeans or peanuts, and 1 tsp. sugar.
Add 1 tsp. Sichuan peppercorns if desired and cook for about a minute.
If you want to amp up the heat, simmer for about 3–5 minutes more.
Add a splash of sesame oil and stir in 2 tsp. sesame seeds if using.
Transfer the chili crisp to a sealed container and refrigerate.
