Cut the pandanus fruit into segments and remove the edible inner kernels from each segment.
Wash the kernels thoroughly to remove any sap and fibrous material.
In a large saucepan, combine the coconut milk, sugar, vanilla extract, ground cinnamon (if using), and ground nutmeg (if using).
Heat the mixture over medium heat, stirring constantly until the sugar is dissolved and the mixture is well combined.
Bring the mixture to a gentle simmer.
Add the cleaned pandanus kernels to the coconut milk mixture.
Continue to simmer for about 10-15 minutes, or until the kernels are tender and have absorbed some of the coconut milk flavors.
Remove the saucepan from the heat and let the mixture cool slightly.
Enjoy your meal!