Preheat the oven to 350°F.
Grease and line two 9 inch round cake pans with parchment paper, and then grease the parchment paper and dust with cocoa powder.
Sift the dry ingredients for the cake layers (flour, cocoa, baking powder, baking soda, and salt) into a medium bowl.
2 cups (240 grams) cake flour, 6 tablespoons (36 grams) unsweetened cocoa, 1 teaspoon baking powder, 1 teaspoon baking soda, ¼ teaspoon salt
In the bowl of stand mixer (or in a large mixing bowl if using a hand mixer), beat the butter for 3 to 5 minutes until soft and light, scraping the bowl intermittently.
8 tablespoons (4 ounces) unsalted butter, softened
Add the sugar, and beat the butter and sugar together until light and fluffy, another 1 to 2 minutes.
1½ cups (300 grams) granulated sugar
Add the eggs, one at a time, and beat for one minute after each one.
2 eggs, room temperature
Scrape the bowl, add the vanilla, and beat for an additional minute.
1 teaspoon vanilla
Measure out the buttermilk into a 2 cup measuring cup, and then add the vinegar and food coloring (see notes) to the measuring cup.
1 cup buttermilk, 1 teaspoon white vinegar, food coloring, if desired (see notes)
Add the dry ingredients in three parts and alternate with the buttermilk mixture (in two parts), starting and ending with the dry ingredients. Mix only as long as needed to incorporate the addition, and scrape down the bowl as needed.
Pour the batter into the prepared pans, even the batter out in the pan, and give it one or two gentle thwacks (i.e. careful drops) onto the kitchen counter to remove any air bubbles.
Bake on a middle rack of the oven for about 25 minutes until a toothpick or knife inserted into the center comes out clean. I start checking for doneness at about 18 to 20 minutes.
Cool the cake layers in the pans for about 10 minutes and then turn out onto cooling racks. Cool completely.