Preheat oven to 350 degrees F. Butter and lightly flour 4 (or 2) 8-inch cake rounds. Line with parchment paper and set aside.
In the bowl of a stand mixer fitted with a paddle attachment, cream butter until smooth. Gradually add sugar and beat until fluffy in texture. Scrape down bowl as needed.
Add eggs one at a time, ensuring each egg is incorporated before adding the next one. Scrape down bowl as needed to ensure even mixing.
In a medium bowl, whisk together flour, baking soda, salt, cocoa powder, and espresso powder. (Espresso powder or instant espresso coffee is optional. I like to use it because it helps heighten and highlight the chocolate notes.) Make sure there are no cocoa powder lumps. If desired, sift ingredients together. Set aside.
Add vanilla extract to milk. Stir together.
Add 1/3 of dry flour mixture to mixing bowl. Mix on low speed until almost combined. Follow with half of milk mixture. Repeat and end with the last 1/3 of flour mixture. Mix until thoroughly combined and there are no streaks of flour left.
Divide batter evenly between four 8-inch cake rounds. If you only have two cake rounds, divide by two and split cake layers after baking. I like to use a large cookie scoop to distribute the batter. Use a mini offset spatula to even out the cake batter. Bake for 25-30 minutes until cakes are done and toothpick inserted in center of cake comes out clean.
Let cakes cools for 5-10 minutes before unmolding. Run a mini offset spatula along the edges of the cake, unmold, and let cake cool to room temperature on wire rack.