Before you start, you'll want to check and make sure you butter is the correct temperature for your cookies AND the frosting. It should be between 65-67 degrees, you can use a digital thermometer to check this.It should be soft enough that your finger leaves a slight indent when you press on it, not greasy or overly soft.
In the bowl of a stand mixer fitted with the paddle attachment or using your hand beaters, add the softened butter and granulated sugar and mix on high for 3 minutes until light and creamy. Don't stop before you've creamed the butter 3 minutes!
1 (226g) cup unsalted butter, 1 (200g) cup granulated white sugar
Add the sourdough discard, egg, egg yolk, vanilla extract, and almond extract (if using) to the butter sugar mixture. Mix this on LOW to incorporate the ingredients, once you've added the discard which has flour overmixing can make the cookies cakey.
⅓ (80g) cup sourdough discard, 1 large egg, 1 large egg yolk, 1½ teaspoons vanilla extract, ⅛ teaspoon almond extract
Whisk the flour, baking powder, and salt in a bowl, then add to the wet ingredients. Mix on low again just until the dough comes together and no flour streaks remain. DO NOT overmix or the cookies will be tough!
3¼ (385g) cups all-purpose flour, ½ teaspoon baking powder, 1 teaspoon fine sea salt
Success Tip: Weighing the ingredients in grams is the the best way to ensure success when you're baking!
Make sure you use a spatula to mix the bottom of the bowl to make sure all of the ingredients get evenly mixed; butter can accumulate at the bottom and create inconsistent baking for the cookies.