Preheat your oven to 375°F (190°C). Line two baking sheets with parchment paper or silicone baking mats.
In a medium bowl, whisk together the flour and baking soda. Set aside.
In a large bowl, using an electric mixer on medium speed, beat the butter, granulated sugar, brown sugar, and salt until light and fluffy, about 3 minutes. Scrape down the sides of the bowl as needed.
Add the eggs one at a time, beating well after each addition. Beat in the vanilla extract until combined.
Reduce mixer speed to low. Gradually add the flour mixture, mixing just until no streaks of flour remain. Do not overmix.
Using a rubber spatula, gently fold in the chocolate chips and walnuts (if using) until evenly distributed.
Drop rounded tablespoons of dough (about 1.5 tablespoons each) onto the prepared baking sheets, spacing them 2 inches apart. Bake for 10-12 minutes, until edges are golden brown and centers are still slightly soft.
Let the cookies cool on the baking sheet for 5 minutes, then transfer to a wire rack to cool completely. Serve warm or at room temperature.