Line a 9x9 inch square pan with parchment paper, leaving some overhang for easy removal. Set aside.
In a heavy-bottomed saucepan, combine the granulated sugar and corn syrup. Stir until well mixed.
Place the saucepan over medium heat and cook the mixture, stirring constantly, until it begins to boil, about 5-7 minutes.
Slowly pour in the heavy cream while stirring continuously. Be cautious as the mixture may bubble up significantly.
Add the unsalted butter and cocoa powder to the pan. Stir until fully blended and the butter has melted.
Stir in the instant espresso powder and pure vanilla extract until fully incorporated.
Attach a candy thermometer to the saucepan, ensuring it does not touch the bottom. Cook over medium heat until the mixture reaches 245°F (118°C), the firm ball stage.
Carefully pour the caramel into the prepared pan, smoothing the top. Sprinkle flaky sea salt on top if desired.
Allow the caramels to cool at room temperature for at least 4 hours or until completely set.
Use the parchment overhang to lift the caramels out of the pan. Cut into squares or rectangles with a sharp knife.
Wrap each caramel in wax or parchment paper, twisting the ends to secure.