Preheat the oven to 350 degrees F. Line a large baking sheet with parchment paper or a Silpat baking mat. Set aside.
In a medium bowl, whisk together the flour, baking soda, baking powder, and salt. Set aside.
In the bowl of a stand mixer with the paddle attachment, combine the butter and sugars together until creamy and smooth. Scrape down the sides of the bowl with a spatula, as necessary.
Add the eggs and vanilla extract and mix until combined. Scrape down the sides of the bowl with a spatula.
Add the dry ingredients and mix on low until just combined. Don’t over mix. It is ok if there are still a few flour streaks left. Add the M&M’s and stir with a spatula.
Use a cookie scoop or roll the cookie dough into balls, about 2 tablespoons per cookie. Place on prepared baking sheet, 2-inches apart. Bake for 10 to 12 minutes or until cookies are slightly golden brown around the edges, but still soft in the center. Don’t over bake.
Remove from the oven and sprinkle with flaky sea salt. Gently press a few M&Ms on top of the warm cookies. Let the cookies cool on the baking sheet for 5 minutes. Transfer to a cooling rack and cool completely.