Separate the leaves from the stem. Discard the bad leaves and wash the leaves and the stems thoroughly in water. There is a lot of mud and sand, so it needs to be washed at leaves 4 to 5 times by changing the water until the water looks clear.
Finely chop the leaves and stems but keep both separately as we will be cooking the stems first and then followed by the leaves.
Heat oil in a kadhai or wok and add mustard seeds. Once it stops spluttering, add chopped onion, curry leaves, dry red chilies, green chilies, and ginger. Fry for a few seconds and then add the finely chopped stems. There is no need to brown the onion. Cover and cook till the stems turn slightly soft.
Now add finely chopped leaves (4 to 5 cups or more) and sugar and stir till it combines well with other ingredients. Cover and cook for 5 minutes or till leaves have softened and cooked through. Season with a bit of salt. Amaranthus has salt naturally so there is no need to add too much salt.
Finally, add freshly grated coconut and cook for a couple of minutes.
Stir well and serve hot with steamed rice and curry or just serve as a warm salad.