Soak both the lentils in warm water for atleast an hour before roasting.
In a pan, heat 1 tbsp oil. Now add all the lentils. Roast till it is fragrant and gets golden brown colour. Take it out and set aside.
Now add another tbsp of oil and add roughly chopped garlic. Sauté till rawness goes.
Then add pearl onions or red onion and dry red chilies. Cook onions till they become translucent. There is no need to brown onions.
Now add roughly chopped tomatoes, salt and the roasted lentils. Cook everything till tomatoes get mushy and soft.
Switch off the flame and allow it to cool a bit. Transfer everything into a blender jar.
Also, add tamarind and coconut (if using) along with little bit of water.
Remove the lid, scrape the sides. Add more water if required till it becomes a smooth paste.
Remove the chutney in a bowl and keep aside.