In a medium bowl, beat the softened butter, brown sugar, and granulated sugar with an electric hand mixer on medium speed for about 1 minute until well combined.
Add the egg yolk and vanilla, then beat until well mixed.
In a small bowl, stir together the flour, baking soda, cornstarch, and salt.
Gradually add the dry ingredients to the wet ingredients, mixing on low speed until a dough forms.
Fold in the M&Ms.
Line a baking sheet with parchment paper or a silicone baking mat. Scoop the dough into 2-3 tablespoon portions and place them on the baking sheet about 2 inches apart. Roll the dough into balls.
Bake for 8 to 10 minutes, or until the edges are lightly browned.
Let the cookies cool on the baking sheet for 5 minutes before transferring them to a wire rack to cool completely.
Notes
Expert Tips
Measure the flour correctly: Use a spoon to scoop flour into a measuring cup made for dry ingredients and slightly overfill it. Then, use the back of a knife or other straight-edged utensil to level the flour across the cup. Do not scoop the flour. When you scoop, the flour gets packed too tightly and you will end up with more than the recipe calls for.
The best way to soften butter is to put it out on the kitchen counter for a half hour before you want to use it.
Line the baking sheet: Use a silicone mat or parchment paper to line your baking or cookie sheet. I don't recommend coating your baking sheet with butter or oil spray because it creates an overly greasy sheet that will make your cookies spread.
Make photo-worthy cookies: A secret to making beautiful M&M cookies that are loaded with M&M candies is to press a few of the M&Ms into the tops of the balls of cookie dough right before baking. I usually do this when I'm bringing a small batch of these cookies to a friend or neighbor.