In a non-stick pan, heat the ghee over medium heat.
Add the ricotta cheese and cook for about 5 minutes, stirring continuously until it thickens slightly.
Stir in the sweetened condensed milk, sugar, and cardamom powder. Cook for another 5-7 minutes, stirring frequently until the mixture begins to leave the sides of the pan.
Add the shredded coconut and mix well. Cook for an additional 2-3 minutes until everything is well combined and thickened.
Remove the mixture from heat and let it cool slightly.
Grease a square or rectangular dish with a little ghee. Pour the mixture into the dish and spread it evenly.
Allow it to cool completely at room temperature, then refrigerate for at least 2 hours to set.
Once set, cut into squares or rectangles and garnish with chopped pistachios or almonds if desired.