Start by preheating your oven to 175°C (350°F). Lightly grease a 9×5-inch (23×13 cm) loaf pan and line it with parchment paper to prevent sticking.
In a large mixing bowl, sift together the all-purpose flour, baking powder, baking soda, salt, ground cinnamon, and nutmeg. Mix well and set aside. This step ensures your dry ingredients are well combined and your loaf rises evenly.
In another mixing bowl, whisk together the granulated sugar, brown sugar, and eggs until the mixture becomes light and fluffy. This helps create a soft, tender crumb. Gradually pour in the vegetable oil while whisking to create a smooth and glossy batter.
Add the milk and vanilla extract to the wet mixture, whisking until fully incorporated.
Pour the dry ingredients into the wet mixture. Use a spatula or wooden spoon to gently fold them together until just combined. Be careful not to overmix, as this can make the loaf tough.
Fold in the finely grated carrots and the chopped nuts or raisins, if using. Make sure the carrots are evenly distributed throughout the batter.
Pour the batter into your prepared loaf pan and smooth the top with a spatula. Gently tap the pan on the counter to remove any air bubbles.
Place in the preheated oven and bake for 45–55 minutes. Check for doneness by inserting a toothpick into the center – it should come out clean or with just a few moist crumbs.
Once baked, remove from the oven and let the loaf cool in the pan for 10 minutes. Then lift it out using the parchment paper and transfer it to a wire rack to cool completely before slicing.