**Preheat the oven** Preheat your oven to 325°F (165°C). Grease and flour a 9x5-inch loaf pan or line it with parchment paper.
**Cream butter and sugar** In a large mixing bowl, beat the softened butter and sugar on medium speed until light and fluffy, about 2–3 minutes.
**Add eggs and vanilla** Beat in the eggs one at a time, ensuring each is fully incorporated before adding the next. Stir in the vanilla extract.
**Mix dry ingredients** In a separate bowl, whisk together the flour, cocoa powder, baking powder, and salt.
**Combine wet and dry** Gradually add the dry ingredients to the butter mixture in three parts, alternating with the sour cream or yogurt in two parts (dry-sour cream-dry-sour cream-dry). Mix just until combined; do not overmix.
**Bake** Pour the batter into the prepared pan, smoothing the top with a spatula. Bake for 60–70 minutes, or until a toothpick inserted into the center comes out with a few moist crumbs.
**Cool** Let the cake cool in the pan for 10 minutes, then transfer it to a cooling rack to cool completely. Dust with powdered sugar or drizzle with glaze if desired.