01 - Preheat oven to 350°F. Grease a 9-inch square baking pan or line it with parchment paper.
02 - In a medium bowl, whisk together flour, baking powder, baking soda, and salt until evenly mixed.
03 - In a large bowl, beat softened butter and granulated sugar until light and fluffy using a mixer or whisk.
04 - Add eggs one at a time to the butter mixture, beating well after each addition, then mix in vanilla extract.
05 - Stir sour cream into the wet ingredients until just combined.
06 - Gradually fold the dry mixture into the wet ingredients, stirring gently until incorporated without overmixing.
07 - In a separate bowl, mix light brown sugar, flour, and cinnamon. Stir in melted butter until crumbly, then fold in nuts if using.
08 - Spread half of the batter evenly in the prepared pan. Sprinkle half of the streusel topping over the batter.
09 - Layer the rest of the batter over the streusel, then top with the remaining streusel mixture.
10 - Bake for 35 to 40 minutes or until a toothpick inserted in the center comes out clean.
11 - Allow to cool in the pan for 15 minutes before slicing and serving.