First, grab a small bowl and combine your all-purpose flour, baking powder, and salt. Whisk them together to ensure everything is evenly distributed. This simple step prevents pockets of baking powder or salt in your finished cookies. Set this bowl aside for now.
In a larger mixing bowl, use an electric mixer on medium speed to cream the softened butter and sugar. Continue mixing for about two minutes until the mixture is light and fluffy. Then, add the eggs one at a time, beating well after each addition. Finally, mix in your choice of almond or anise extract.
Now it’s time to bring it all together. Gradually add the dry ingredient mixture to your wet ingredients. Mix on low speed just until the flour is incorporated. Be careful not to overmix, as this can lead to tough cookies. The dough will be quite sticky at this point, which is completely normal.
Using a tablespoon or a small cookie scoop, roll the dough into balls about one inch in size. Place them on a baking sheet lined with parchment paper, leaving some space between each one. Refrigerate the tray of cookie dough balls for at least one hour. This step is crucial for helping the cookies hold their shape while baking.
Preheat your oven to 350°F (175°C). Place the chilled cookies in the oven and bake for 10–12 minutes. You’ll know they are done when they are just set and the bottoms are a very light golden brown. Let them cool on the baking sheet for a few minutes before transferring them to a wire rack to cool completely.
While the cookies cool, prepare the frosting. In a small bowl, whisk together the powdered sugar, milk, and extract. Add the milk one tablespoon at a time until you have a thick but pourable glaze. Once the cookies are completely cool, you can either dip the tops in the glaze or drizzle it over them. Immediately add the rainbow sprinkles while the frosting is still wet.