In a bowl, combine yogurt, ginger paste, garlic paste, turmeric powder, red chili powder, ground cumin, ground coriander, and salt. Mix well.
Add the chicken or lamb pieces and coat them with the marinade. Cover and refrigerate for at least 1 hour, preferably overnight.
Rinse the basmati rice under cold water until the water runs clear. Soak for 30 minutes, then drain.
In a large pot, bring 4 cups of water to a boil. Add salt and a few whole spices (like cloves, cardamom pods, and a bay leaf).
Add the soaked rice and cook until 70% done (the rice should still be a bit firm). Drain and set aside.
In a large, heavy-bottomed pot or pressure cooker, heat the oil or ghee over medium heat.
Add the sliced onions and cook until golden brown.
Add the marinated meat and cook until it is browned and cooked through.
Stir in the chopped tomatoes and cook until they soften.
Add ground cumin, ground coriander, turmeric powder, red chili powder, and garam masala. Mix well and cook for a few minutes.
Remove half of the meat mixture from the pot and set aside.
Layer half of the partially cooked rice over the meat left in the pot.
Sprinkle some fresh cilantro, mint leaves, and fried onions (if using) over the rice.
Add the reserved meat mixture over this rice layer.
Top with the remaining rice and sprinkle with more cilantro, mint leaves, and fried onions.
If using milk with saffron, drizzle it over the top layer of rice.
Cover the pot with a tight-fitting lid. Cook on low heat for 20-25 minutes to allow the flavors to meld (this process is called "dum").
Gently fluff the biryani with a fork before serving.
Enjoy your meal!