Heat oven to 350°F. Grease two 8-inch or 9-inch round cake pans. Line bottoms with parchment, then grease the parchment.
In a medium bowl, whisk together flour, baking powder, and salt.
In a small bowl or measuring cup, stir together milk and sour cream (if using).
In a stand mixer (or with a hand mixer), beat butter and granulated sugar on medium-high until light and fluffy, about 3 to 4 minutes. Scrape the bowl once or twice.
Add eggs one at a time, mixing well after each. Mix in vanilla.
On low speed, add the flour mixture in 3 additions, alternating with the milk mixture in 2 additions. Mix just until you stop seeing dry streaks.
Split batter evenly between pans and smooth the tops.
Bake for 24 to 30 minutes, depending on pan size and oven. The center should spring back lightly and a toothpick should come out clean or with a few moist crumbs.
Cool in pans for 10 minutes, then turn out onto a rack, peel off parchment, and cool completely before frosting.
Beat butter on medium-high until creamy, about 2 minutes. Mix in powdered sugar 1 cup at a time on low, then increase speed to medium. Add vanilla and a pinch of salt.
Add milk or cream 1 tablespoon at a time until spreadable and fluffy. Beat 1 more minute on medium-high.
If your cake layers domed, level them with a serrated knife.
Place one layer on a plate or cake stand. Add a thick layer of buttercream and spread to the edges. Add second layer, then apply a thin crumb coat all over.
Finish frosting with the remaining buttercream.
