Prep the pan and oven. Line a 12-cup muffin tin with paper liners.
Preheat the oven to 350°F (175°C). Make sure your rack is in the center position for even baking.
Mix dry ingredients. In a large bowl, whisk together flour, sugar, cocoa powder, baking powder, baking soda, and salt until no streaks remain. Breaking up cocoa lumps now keeps the batter smooth.
Add wet ingredients (except hot water/coffee). Pour in milk, oil, eggs, and vanilla.
Whisk until the mixture looks mostly smooth. Don’t worry about tiny lumps.
Stir in hot water or coffee. Slowly whisk in the hot liquid. The batter will look thin—this is what makes the cupcakes moist and tender.
Fill the liners. Divide the batter evenly among the 12 cups, filling each about two-thirds full.
A cookie scoop or measuring cup helps keep them uniform.
Bake. Bake for 16–20 minutes, or until the tops spring back when lightly pressed and a toothpick comes out with a few moist crumbs, not wet batter.
Cool. Let cupcakes sit in the pan for 5 minutes, then transfer to a cooling rack. Cool completely before frosting or the frosting will melt.
Make the frosting. In a medium bowl, beat softened butter until creamy. Add cocoa powder, half the powdered sugar, a pinch of salt, and 2 tablespoons milk.
Beat on low until combined, then on medium until fluffy. Add remaining powdered sugar, adjusting milk a little at a time until you reach a soft, spreadable consistency. Beat in vanilla.
Frost and sprinkle. Spread or pipe frosting onto cooled cupcakes.
Add sprinkles right away so they stick. Let kids decorate their own for extra fun.