You can use fresh grated coconut or if you can't find one, you can buy frozen dessicated coconut
Mix the grated coconut with ground spices and stir to mix evenly
Preheat a large skillet without any oil over low heat. Add in the coconut mixture, bay leaves, lime leaf, galangal and stir fry until the coconut is really dry and crispy and sprinkle in the sugar while stirring. This may take a while and remember to do this over low heat or you are risking burning the coconut before it's dry. Once it's completely dry, crispy, and golden brown, remove from the heat. Discard the leaves and galangal
Store in air-tight container when it's completely cool