Preheat your oven to 350°F (175°C).
In a medium bowl, whisk together the all-purpose flour, baking soda, baking powder, and salt. Set aside.
In a large mixing bowl, cream the unsalted butter, light brown sugar, and granulated sugar together until light and fluffy, about 2-3 minutes.
Add the eggs, one at a time, mixing well after each addition, then stir in the vanilla extract.
Gradually add the dry ingredients to the wet mixture, mixing on low speed until just combined.
Gently fold in the M&Ms until they're evenly distributed throughout the dough.
Scoop rounded tablespoons of dough onto prepared baking sheets, spacing them about 2 inches apart.
Bake for 10-12 minutes until the edges are lightly golden but the centers are still soft.
Sprinkle a pinch of flaky sea salt on top of each cookie as soon as they come out of the oven.
Allow to cool on baking sheets for about 5 minutes before transferring to a cooling rack.