In a large bowl, sift together flour, baking powder, and salt. Set aside.: You should notice the flour becoming lighter and aerated after sifting, with no visible clumps, which makes for an even dough. The dry aroma is faintly wheaty and clean, a neutral base for the sweeter components to build on. Use a bowl large enough to whisk comfortably so you mix everything uniformly, and avoid compacting the flour back down after sifting, because that can make the cookies dense. A common mistake is skipping the sifting step, which can leave pockets of leavener and create uneven texture.
In a stand mixer with the paddle attachment on medium speed, or with an electric mixer, beat butter and sugar until pale and fluffy. Beat in egg yolks and vanilla.: You will hear a steady, soft whir and see the butter lighten in color to a pale cream, indicating air has been incorporated. The sugar should dissolve into the butter so the mixture looks smooth, and when you add the egg yolks it will become silkier. This aeration impacts texture, giving the cookies a tender crumb with a slight lift. Be careful not to overbeat to the point of separation, and if the mix looks curdled, pause and scrape before continuing, because overworking can affect final spread.
Reduce mixer speed to low and gradually add flour mixture and milk until just incorporated. Scrape dough on to a floured work surface, shape into a ball, and wrap in plastic wrap. Chill at least 2 hours or up to 2 days in advance.: You will hear the change in motor pitch as the mixer slows, and the dough will transition from sticky to smooth and manageable. When you scrape it out, it should feel cool and slightly tacky, not wet. Chilling solidifies the fat, which prevents excessive spreading during baking and helps maintain crisp shapes. If the dough feels too dry after chilling, allow it to warm slightly, but avoid letting it soften too much, as that causes misshapen cookies. A common pitfall is skipping the chill, which leads to flat, distorted cookies.
Preheat oven to 350 degrees. Line 2 baking sheets with parchment paper or silicone mats.: Preheating brings the oven to a stable environment so the cookies bake evenly from the moment they go in, and lining sheets prevents sticking and encourages an even bottom color. You may feel a warm blast when opening the oven, and the steady heat helps set the cookie edges quickly for a neat silhouette. Not preheating is a frequent error, resulting in inconsistent texture and longer bake times.
On a floured surface, roll chilled dough between parchment paper or wax paper to 1/8-inch thickness. Cut with heart-shaped cookie cutters. Transfer to prepared baking sheets with an offset spatula.: As you roll, the dough should unstick cleanly from the paper and spread out to an even, thin sheet that makes uniformly thin cookies. The sound is soft and flour-dusted, and the visual cue is a smooth sheet with no major cracks. When transferring, an offset spatula helps preserve the shape, and the thin thickness promotes a delicate crackle at the edges when baked. Avoid overflouring the surface, which can dry the dough and make the cookies tough.
Repeat with the remaining dough. Scrape all remnants together and re-roll. If the dough becomes too soft or sticky, refrigerate an additional 10 minutes.: You will collect trimmings and press them into a cohesive ball, which may feel slightly warm from handling. Re-rolling yields slightly denser cookies but keeps waste minimal. Chilling again firms the fat so shapes remain crisp in the oven. Watch for overheating from repeated handling, because warm dough spreads more and loses definition.
Bake until the edges are lightly browned, about 8 to 10 minutes (if thicker than 1/8 inch, they may take 10 to 15 minutes). Transfer to wire racks and cool completely before decorating with frosting (recipe follows).: While they bake you will smell butter and a hint of caramelization, and the edges will shift from pale to a gentle golden tone. The sound is mostly quiet, with an occasional light crack as they set. Cooling on racks prevents steam from making bottoms soggy, preserving crispness. Baking too long will make them dry and overly crisp, so err on the shorter side and check visually for the subtle color change.
In a stand mixer fit with the whisk attachment on medium-high speed, add the egg whites and vanilla and beat until foamy.: The mixture will begin as clear and slightly viscous, then turn opaque with a frothy texture. You will hear an energetic whisking noise and see lots of tiny bubbles. This initial aeration is essential to build volume and structure for the frosting, which will eventually hold peaks. Underwhipping at this stage means you will not achieve the right stability, while overwhipping can break the foam.
Reduce mixer speed to low and add the powdered sugar until just incorporated and shiny. Beat on high for 5 to 7 minutes or until the mixture is thick and glossy with stiff peaks.: After the sugar is added, the texture becomes smoother and denser, and on high speed the mixture will inflate into a glossy, marshmallow like mass. You should see ribbons and stiff peaks that hold their shape, and the frosting will have a clean, sweet perfume. This long whipping time builds structure so the frosting sets firm. A common mistake is not using pasteurized whites or not whipping long enough, which leads to runny icing that will not pipe neatly.
Add food coloring if desired, then transfer to piping bags or spread with a spatula. If using sprinkles or sugar, add quickly before the frosting hardens.: Colored frostings are visually striking, and you will notice the sheen dull slightly as it begins to set. The tactile cue is a glossy surface that starts to stiffen at the edges after a few minutes. Work quickly with decorations because the frosting forms a crust that locks them in place; waiting too long makes them bounce off. If the icing stiffens prematurely, a few drops of water can loosen it, but add sparingly to avoid thinning too much.
To make in advance, store in an airtight container in the refrigerator for up to 3 days.: Proper storage keeps the cookies fresh, and cold storage helps frosting maintain texture without becoming sticky. When refrigerated, allow cookies to return to room temperature before serving so flavors are more pronounced. A common oversight is using non airtight containers, which leads to dried edges or frosting that picks up other flavors in the fridge.