Peel shallots and garlic. The uncut shallot and garlic should roughly measure about ½ cup (little more or less is fine). For the ease of making, I bought peeled garlic pods instead of the whole ones.
In a food processor or the blender, mince the shallot and garlic separately. We will fry them both separately since they both have different cooking time.
Add ¼ cup of oil in a pan and heat it. Add the dried red chili and fry, stirring constantly. Take care not to burn the peppers. Keep stirring them constantly and fry over low flame, until the red chilies are dark. Transfer the chilies to a large bowl.
In the same pan, add ¼ cup oil and fry the minced shallots. Fry the shallots until they turn light brown in color. This should take about 10 mins. Pour the fried shallots out in the same bowl as the red chilies.
In the same pan, add ¼ cup of oil and fry the minced garlic. Fry them until golden brown and then drain it in the same bowl along with the others. Garlic should fry faster than the shallots.
Now add all the fried ingredients in a blender jar or food processor jar and add the salt, sugar and tamarind paste. Pulse until the chilies are ground and well mixed.
Transfer the ground mixture back to the same pan that we used for frying and add the remaining oil. Fry the chili paste over low heat for about 15 mins. At this stage you could also just heat it through for 5 mins, but the longer they fry the better shelf life they have. Taste the chili paste and adjust the sweetness or the sourness based on your liking.