Cook the coconut rice: Rinse the rice under cold water until the water runs clear to remove excess starch. In a medium pot, combine the rice, coconut milk, water, salt, and pandan leaves (if using). Bring it to a boil over medium heat, then reduce the heat to low, cover, and let the rice simmer for about 15-20 minutes until fully cooked. Once done, remove from heat and let the rice sit covered for another 10 minutes before fluffing with a fork.
- Prepare the sambal: In a blender or food processor, combine the red chilies, garlic, onion, and dried shrimp paste (if using). Blend into a smooth paste, adding a little water if necessary. In a medium-sized pan, heat the vegetable oil over medium heat. Add the chili paste and cook, stirring occasionally, for about 5-7 minutes until fragrant and the oil begins to separate from the paste. Stir in the tamarind paste (or lime juice), sugar, and salt to taste. Cook the sambal for an additional 5 minutes until it thickens. Set aside.
- Prepare the accompaniments: Fry the anchovies in a small pan with a little oil until crispy, about 2-3 minutes. Set aside. If your peanuts are not already roasted, dry-toast them in a pan for 3-4 minutes until golden and fragrant. Hard-boil the eggs by placing them in a pot of water, bringing it to a boil, and then simmering for 9-10 minutes. Once cooked, peel and set aside.
- Fry the eggs (optional): For a more traditional presentation, fry the eggs sunny side up or to your desired level of doneness. The runny yolk adds a rich, creamy texture to the dish.
- Assemble the Nasi Lemak: On a large serving plate, scoop a portion of the coconut rice. Arrange the fried anchovies, peanuts, boiled egg, and sambal on the side. Top with the fried egg, if desired, for an extra indulgent touch. Serve with fresh cucumber slices for balance.
- Serve: Serve your Nasi Lemak hot, with the sambal as the star of the dish. This dish is typically eaten with your hands in Malaysia, but you can use utensils if preferred. Pair it with a hot cup of tea or coffee for an authentic experience.