Preheat the Oven: Begin by preheating your oven to 350°F (175°C) and greasing a 9x13 inch baking pan.
Combine Dry Ingredients: In a mixing bowl, whisk together the flour, baking soda, baking powder, salt, and cinnamon. Set aside.
Cream Butter and Sugar: In another bowl, cream the softened butter and granulated sugar together until the mixture becomes light and fluffy.
Add Eggs and Vanilla: Beat in the eggs one at a time, followed by the vanilla extract, mixing well after each addition.
Incorporate Sour Cream: Stir in the sour cream until the mixture is well combined.
Combine Dry and Wet Ingredients: Gradually add the flour mixture to the butter mixture, mixing until just combined.
Fold in Apples and Nuts: Gently fold in the diced apples and chopped nuts, if desired.
Pour into Pan: Pour the batter into the prepared baking pan and spread it evenly.
Bake: Bake in the preheated oven for about 45-50 minutes, or until a toothpick inserted in the center comes out clean.
Cool and Serve: Allow the cake to cool in the pan, then dust with powdered sugar if desired before slicing and serving.