As luckfatima has stated it is not commonly used any more.
But in Europe it was used for its coloring more than flavoring. Does the recipe your cooking have any other colorant in it and does it make any reference to what color the dish should be?
Your substitute may be Turmeric , Saffron or food coloring.
Wikipedia tells me that red sandalwood is what in N. Indian languages is known as "chandan" so I think the info I can give is applicable to your query on red sandalwood, although I didn't realize that there were different varieties of sandalwood. It is used as an ayurvedic treatment in pill or paste form for internal use, but more frequently, the paste or oil is applied directly to the skin. It is known to combat oily skin and acne. When taken internally it is supposedly good for the heart and liver. Besides religious use for Hindus, and medicinal significance, sandalwood is used in some types of Indo-Pak recipes, particularly in refreshing drinks.
It can also be an ingredient in paan (I have no idea how to explain what paan is, so I will let you look that one up if you don't know already).
As far as consumption as food, I have seen it used in drinks in Pakistan-India. You can buy sandalwood syrup to make "sharbat" (think like a cooler or mocktail). If you google "chandan ka sharbat" or "sandal ka sharbat" you will get some recipes.
Here is a recipe for a Saffron Sandalwood Cooler from Tarla Dalal's website, she uses paste made from the wood and not the syrup:
Sandalwood is not used in daily cooking in any Indo-Pak cuisine to my knowledge (correct me if I am wrong) but I have heard of it being used in very fancy Lucknowi nawaabi or Mughlai recipes like fancy qormas or kabaabs. The sandalwood paste gives that same perfumed flavor profile to the dishes as rose water and kewra jal (vetiver or screwpine essence), and there are also other fancy and not commonly used ingredients in these types of dishes like silver or gold foil garnish. These are historic recipes or recipes on fancy hotel festival menus. Supposedly some famous kabaab places in Lucknow still use sandalwood in their fare, even though their establishments are much more humble than nawaabi these days.