Prep your pan and oven: Preheat the oven to 350°F (175°C). Grease and line a 9-inch round cake pan or an 8x8-inch square pan with parchment. For a two-layer cake, double the recipe or bake in two 8-inch pans.
Whisk dry ingredients: In a large bowl, whisk flour, baking powder, baking soda, salt, cinnamon, and nutmeg until well combined.
Combine wet ingredients: In another bowl, whisk granulated sugar, brown sugar, yogurt, milk, oil, and vanilla until smooth and slightly thickened.
Bring it together: Pour the wet mixture into the dry ingredients.
Gently fold with a spatula until you no longer see dry flour. Do not overmix.
Add carrots (and extras): Fold in the grated carrots, and nuts or raisins if using. The batter will be thick and speckled with carrots.
Bake: Spread batter evenly in the pan.
Bake for 30–36 minutes, until the top is set and a toothpick comes out clean or with a few moist crumbs.
Cool completely: Let the cake cool in the pan for 10 minutes, then lift out using the parchment and cool fully on a rack. Don’t frost a warm cake.
Make the frosting: Beat cream cheese and butter until smooth and fluffy, 2–3 minutes. Add powdered sugar, vanilla, and salt.
Beat until creamy. If needed, add a splash of milk to loosen.
Frost: Spread frosting over the cooled cake. For a layered look, frost between layers and on top, then decorate with chopped nuts or a light sprinkle of cinnamon.
Slice and serve: Use a sharp knife for clean slices.
Wipe the blade between cuts for neat edges.