In a heavy-based saucepan, whisk together the sugar, cocoa powder, cornflour, and a pinch of fine salt until evenly combined. Gradually pour in the milk and cream, whisking continuously to achieve a perfectly smooth base, free from any lumps. Introduce the Guinness, along with the optional espresso, allowing the flavours to gently intertwine.
Place the pan over a moderate heat, stirring steadily as the mixture begins to warm. In time, it will thicken into a glossy, luxurious custard — soft bubbles rising to the surface, ribbons forming with each stroke of the whisk. Once this consistency is reached, remove from the heat and fold in the chopped dark chocolate and vanilla, stirring until fully melted and exquisitely smooth.
Pour the pudding into elegant ramekins, glass jars, or cups of your choosing. Allow to chill for 2–4 hours for a delicately set finish, or serve warm for a more indulgent, molten texture. Finish with a flourish — softly whipped cream, fine shards of chocolate, or a scattering of something crisp for contrast.