To make the caramel, stir the sugar and water together in a small saucepan. Place it over medium heat and bring the mixture to a simmer. Let it simmer while stirring just until the sugar is completely dissolved, which should take no longer than one to two minutes. Remove the pot from heat.
Pour the caramel mixture into an 8-inch round cake pan (Note 2). Set it aside and let it cool. The caramel should firm up as it cools, but it shouldn't become hard (Note 3).
To make the custard, first stir the cold water and cornstarch together in a small container. Set this mixture aside.
Stir the coconut milk, sweetened condensed milk, sugar, agar agar, and salt together in a small saucepan, then place it over medium-high heat. Bring the mixture to a boil while whisking.
Once the mixture comes to a boil, lower the heat so that the mixture is cooking at a simmer. Let it simmer while whisking frequently for four minutes.
Whisk the cornstarch slurry into the coconut milk mixture in the saucepan. Raise the heat back up to medium-high and bring it just back to a boil. It should thicken slightly once it starts to boil again. Remove it from heat.
Stir the vanilla extract into the coconut milk mixture.
Carefully pour the custard into the cake pan, over the caramel, being careful to disturb the caramel as little as possible.
Place the cake pan into the fridge and let it chill until the custard has fully set, about 3 hours.
To remove the flan from the pan, prepare a hot water bath by pouring about an inch of boiling water into a pan large enough to fit your flan. a 9-inch square cake pan should be perfect.
Place the pan containing the flan into your hot water bath. Let it sit for 5 minutes. After 5 minutes, while the flan is still in the hot water bath, gently run a knife around the edges of your flan (Note 4).
Take the pan out of your hot water bath and place a plate over it. Invert the pan to release the flan onto the plate, being careful as the caramel will run out of the pan as this happens.
Slice and serve the flan.