Short answer: underbake slightly and let them finish on the tray.

The secret to a soft middle is pulling them early. Take the cookies out when the edges are set and golden but the centres still look a touch underdone — they’ll look almost raw in the middle, and that’s right. Leave them on the hot tray for about ten minutes: carryover heat finishes the centres gently without drying them out. Brown sugar and not overbaking do the rest.

Related:bakery-style chocolate chip cookies · glossary:crumb,the Maillard reaction.