Line your 8x8-inch baking pan with parchment paper, leaving some overhang to make removal easier later.
In a heavy-bottomed saucepan, combine the granulated sugar, corn syrup, and heavy cream. Stir gently until the sugar is dissolved.
Place the saucepan over medium heat and bring the mixture to a boil. Attach your candy thermometer and allow the mixture to cook without stirring until it reaches 240°F (soft ball stage).
Remove from heat and quickly whisk in the unsalted butter, unsweetened cocoa powder, instant espresso powder, and pure vanilla extract. Stir until smooth.
Carefully pour the hot caramel mixture into your prepared baking pan. Let it cool at room temperature for at least 4 hours or until fully set.
Once cooled, use the parchment overhang to lift the caramels out of the pan. Cut into squares or rectangles and sprinkle with flaky sea salt if desired. Enjoy!