Heat ghee in a pan, add grated coconuts and roast it for few minutes.
Once the coconut flakes are roasted, remove the pan from the stove and keep it aside.
Dissolve the sugar in water and let it get heated in another pan.
Keep stirring, until the sugar and water mixture reaches a syrup consistency.
Add the roasted coconut flakes to the sugar syrup and cook in low flame.
Make sure you keep stirring the mixture, otherwise it may burn at the bottom.
The burfi will soon absorb all the sugar syrup, and it is ready when the coconut mixture thickens and form a soft, firm mass that come off easily from the sides of the pan.
Grease a flat tray or plate with ghee or melted butter.
Transfer the coconut barfi from the pan to the greased tray. When the burfi is cooled enough (about 30 minutes to one hour), you can cut them into pieces (square or diamond shaped slices) and serve!