Switch on your instant pot to sauté and add the oil to the steel insert. When it is slightly hot, add the fried onions, garlic and ginger pastes, tomatoes, and biryani masala powder. Sauté for 5 minutes, adding a splash of water if required to prevent the masala from burning.
Cancel sauté and add ¼ cup water. Secure the lid and make sure the steam release vent is sealed. Press the pressure cooking button (high) and set the timer for 10 minutes. Once the timer beeps, open the pot and if there is still some liquid, dry it on sauté again. You will get a shiny, thick masala.
As the masala is cooking in the instant pot, shallow fry the paneer in 2 tablespoons of oil. Make sure the oil is medium hot, and take out the paneer as soon as it starts turning golden brown. When the masala is ready, add the fried paneer along with the remaining oil to the masala in the instant pot. This is an optional step and you can add unfried paneer cubes to the masala as well.
In a large dutch oven or saucepan, add 8 cups of water, salt and the whole spices (black and green cardamom, bay leaf, cloves and peppercorns). Cover with a lid and bring to a roiling boil.
Remove the lid, add the rice, and let it cook for 4-5 minutes. Take out a few rice grains in the palm of your hands and check for doneness. The rice should be slightly undercooked with slightly hard centres.
Drain the rice in a colander and return half of it to the saucepan. Spread the paneer masala on top of the rice and top with the remaining rice. Sprinkle the food color and top with some extra fried onions, the cilantro and green chillies. Also sprinkle ¼ cup hot water on the rice to prevent it from drying out completely.
Cover the pot with a tight-fitting lid, return it to the hob, and let the biryani cook on very gentle heat for 15 minutes.
Remove the lid and fluff the rice with a fork. Serve hot with raita.
Stovetop Method
Add all the ingredients for the masala in a wide saucepan and cook on low to medium heat until the masala is cooked through. Add a few splashes of water to prevent it from burning and stir it while it is cooking. The masala is cooked when it becomes thick and shiny and the raw smell of the spices goes away.
Follow all the steps from 3-8 given under the instant pot method.