First one how it's supposed to look Second one is how its looked the last few times I tried to cook it
Without the recipe to refer to, I would say that this is due to whatever dairy product you are adding (Butter, cream, yoghurt, coconut milk etc.) splitting due to excessive heat.
If you are using home-made ghee or butter, it could also be due to the milk solids having not been properly separated/removed from the mixture.
The temperature you add dairy, the type of dairy, and the length of time it is exposed to heat are critical factors in not allowing a sauce to split. I would:
Reduce the amount of oil/ghee you use in your recipe, and also look into using a high smoke point oil (e.g. rapeseed) instead of ghee or butter. This will eliminate any solid fat coming out of solution when the liquid is added. This type of splitting can also occur when using hybrid spreads (part fat, part oil) for cooking, which is why pure oils (or high quality ghee) is preferred.
Add the water/stock etc. and gently simmer rather than boil until the ingredients are cooked to the desired amount.
Add the coconut cream etc. towards the end of cooking and do not allow the sauce to come to a boil.