Begin by heating your oven to 350°F (175°C) and prepare two baking sheets by lining them with parchment paper.
In a medium bowl, combine the flour, cocoa powder, baking soda, and salt, and whisk until they are evenly blended. Set aside.
In a large bowl, beat the butter and sugars until light and fluffy using an electric mixer. Subsequently, incorporate each egg individually, making sure to beat the mixture thoroughly after each addition. Then, mix in the vanilla extract.
Gradually blend in the dry ingredients, alternating with the dairy-free milk, until the mixture is smooth and well combined. If you opt for nuts, gently fold them in.
Place rounded tablespoons of the dough onto the lined baking sheets. Ensure there is enough space between each cookie for spreading.
Bake the cookies for 10-12 minutes, ensuring that the edges become firm while the centers stay soft. Avoid overbaking to keep the fudgy texture.
Allow the cookies to cool on the baking sheets for a few minutes before transferring them to a wire rack to cool completely.