To prevent cookies from spreading too much during baking, it's essential to chill the dough. After preparing the dough, refrigerate it for at least 30 minutes, or even overnight if possible. Chilled dough will hold its shape better in the oven, resulting in cookies that are thick and chewy, rather than thin and flat. Additionally, using butter that is slightly cooler than room temperature will also help prevent excessive spreading.