Add rice to a bowl and rinse it well thrice. Drain the water.
Pour fresh water and let it soak for 20 mins while you prepare the other ingredients. Later after 20 mins, drain the water completely.
Add oil or butter to a pot or pressure cooker. Fry cashews on a medium heat until golden. Remove to a small plate and set aside for garnish.
Reduce the heat. To the same pot, add whole spices and fry for 30 seconds, until they turn fragrant.
Add ginger garlic paste and saute for a minute without burning, until it smells fragrant.
Add slit green chili, chopped vegetables and saute for 2 to 3 mins.
Pour the coconut milk along with the water and add salt. Taste and adjust the salt.
Drain the water completely from the rice and add it to the pot. Mix well and cover with the lid.
Cooking in pot: Let the rice cook on a low heat until all of the water is absorbed and is fully tender but not mushy. If the rice is undercooked, sprinkle some warm water and cook until soft. Turn off the heat and let the coconut milk rice rest for 10 mins. Later fluff up with a fork.
Pressure Cooker: Cook on a medium heat until you hear 1 whistle. When the pressure drops, open the lid and gently fluff with a fork.
Optional: Toast the coconut until golden. Garnish coconut milk rice with toasted coconut and cashews.
Press Saute button on the instant pot and pour ghee to the steel insert. Add the whole spices.
When the spices begin to sizzle, add ginger garlic and stir well. Add green chilies, cashews and vegetables. Saute for 2 to 3 mins.
Add 2 cups drained rice, 1½ cups water, 1 cup coconut milk and salt. Give a good stir. Taste test and add more salt if needed.
Secure the instant pot with the lid and position the steam release handle to sealing. Press the pressure cook button (high) and Set the timer to 6 mins.
When the IP finishes, let the pressure release manually for 7 to 8 mins. Later do a manual pressure release. Gently fluff up the coconut milk rice with a fork.
If you want you may toast the coconut separately and garnish.