Crush onion and garlic in mortar and pestle and set aside, then crush chillies separately.
Fry the garlic, onion, coriander, cumin, galangal and sugar on a medium heat until soft.
Then add remaining ingredients and some more oil if required, simmer until everything is cooked and the mixture has become oily. Stir frequently.
