Prepare the ingredients: If you haven’t already, cook the rice and let it cool, ideally overnight in the refrigerator, so that the grains firm up and don’t become too soft when fried. Prepare the vegetables, protein (if using), and sauces in advance.
- Cook the vegetables: Heat the vegetable oil in a large skillet or wok over medium-high heat. Add the chopped onion, garlic, and shallots, and sauté for 2-3 minutes until fragrant and softened.
- Add the protein and vegetables: Stir in the diced carrots and peas (if using), and cook for another 2-3 minutes. If you’re adding cooked chicken, shrimp, or tofu, add them now and stir to combine.
- Fry the rice: Add the cooked rice to the pan, breaking up any clumps. Stir well to coat the rice with the oil and mix in the vegetables and protein. Cook for 3-4 minutes, allowing the rice to get slightly crispy on the bottom.
- Season the rice: Add the soy sauce, sweet soy sauce, oyster sauce (if using), and ground pepper to the rice. Stir everything well to ensure the rice is evenly coated with the seasonings. If you like a bit of heat, sprinkle in the chili flakes or chopped fresh chili at this point. Taste and adjust the seasoning as necessary.
- Fry the eggs: In a separate pan, heat a little oil over medium heat and crack the eggs in, frying them sunny-side up or to your preferred doneness. A runny yolk is traditional and adds richness to the dish.
- Serve: Once the rice is cooked and flavorful, plate the Nasi Goreng. Top each serving with a fried egg, garnish with fresh cilantro, and serve with sliced cucumber or tomato for added freshness. You can also add some sambal or extra chili sauce for more heat if desired.