Take some coconut milk aside and bring the rest to a boil in a saucepan. In the meantime, mix the sugar and cornstarch with the coconut milk that was set aside (works great in a cocktail shaker!).
When the coconut milk is boiling, simply add the sugar-starch mixture and stir vigorously. Bring to the boil again a little, then pour into a dish rinsed with cold water and let cool down.