To achieve soft and chewy cookies, don't overbake them. Remove them from the oven when the edges are lightly golden but the center is still slightly undercooked, allowing them to firm up as they cool.