Prep the pans and oven. Heat the oven to 350°F (175°C).
Grease and line two 8-inch round cake pans (or one 9x13-inch pan) with parchment. Lightly flour the sides to prevent sticking.
Mix the dry ingredients. In a large bowl, whisk flour, sugar, cocoa, baking powder, baking soda, and salt until even. This helps avoid cocoa clumps.
Add the wet ingredients (except hot liquid). Whisk in eggs, oil, yogurt, and vanilla until smooth.
The batter will be thick.
Bloom the cocoa. Stir the hot milk into the batter to loosen and deepen the chocolate flavor. Mix until combined and glossy.
Finish with hot coffee or water. Carefully pour in the hot coffee or water. The batter will look thin—that’s right.
Stir gently until smooth.
Fill the pans. Divide batter evenly between the prepared pans. Tap each pan once on the counter to pop big air bubbles.
Bake. Bake 22–28 minutes for two 8-inch rounds, or 28–34 minutes for a 9x13. The cake is done when a toothpick comes out with a few moist crumbs.
Cool completely. Let cakes cool in the pans for 10 minutes, then turn out onto racks.
Remove parchment and cool fully before frosting.
Make the frosting. Beat softened butter until creamy. Add cocoa, half the powdered sugar, a pinch of salt, and 2 tablespoons milk. Beat until smooth.
Add remaining sugar and more milk, 1 tablespoon at a time, until the frosting is fluffy and spreadable. Beat in vanilla.
Assemble. If making a layer cake, level domes with a knife. Place the first layer on a plate, add a generous frosting layer, then top with the second cake.
Frost the top and sides. Add sprinkles right away so they stick.
Set and serve. Let the frosted cake rest 15–20 minutes so the frosting firms slightly. Slice with a warm knife for clean cuts.