If you're using fresh lemongrass, remove the top 4-5 inches and the bottom stem. Peel the tough outer layer of the lemongrass off until the tender white part remains.
Chop all the ingredients as fine as you can get them so they are easier to grind.
Toast the whole spices in a skillet over medium heat until they start to become fragrant, tossing often to prevent burning. Remove.
Add the garlic, ginger and chilies to the skillet and cook on medium high heat until they start to char on the outside (be careful not to burn them). Remove, peel the outside peels off and set aside.
Combine all ingredients in a mortar and grind with a pestle until a paste forms.
Store in the fridge for up to 3 months, or freeze in 1 tablespoon cubes for up to one year (keep in a freezer safe bag).
Notes
Using a mortar and pestle provide the best results as it lets the oils come out of the ingredients – however, you can use a food processor to make this quicker and easier.
Add more or less Thai chilies depending on the heat level desired (Thai chilies are very spicy).
Substitute dried Thai chilies for the fresh - cut the amount in half to start as dried chilies tend to be spicier.
If your paste is thick, add 1 teaspoon of water at a time to thin it out and make it easier to work with.
Replace the fresh lemongrass with lemongrass paste if desired.
Toast the whole coriander seeds, cumin seeds and cardamom for a slightly smokier flavor.
Adjust the amount of salt to taste if needed.
Char the garlic and shallots with the skins on to ensure the flesh does not burn.