Wash rice with water and keep aside.
Heat oil in a pot. Add all the whole spices. Once they start spluttering, add sliced onion.
When the onion starts turning brown, add ginger-garlic paste and curry leaves. Saute for about a minute.
Add coriander powder, red chili powder, and garam masala. Saute for a few seconds.
Add chopped tomatoes, green chili peppers, salt, and ground black pepper. Mix everything and cook until the tomatoes turn mushy and are nicely cooked. It will take around 5-6 minutes on medium flame.
Once the tomatoes are cooked, add rice. Let the rice grains cook with tomatoes for 1-2 minutes before adding water and roughly chopped cilantro. Mix everything.
Cover the pan and cook for around 15 minutes or until the water gets completely absorbed. Once the rice is cooked, switch off the stove and don't remove the lid for at least 5 minutes.
After 5 minutes, remove the lid and fluff rice with a fork. Garnish with more chopped cilantro.
Enjoy with some raita, chutney, or salad on the side.