Place the coffee beans on a baking sheet & use something blunt to crush them. Set aside.
In a medium saucepan, combine the milk with half of the sugar and place over a medium-low heat. When the milk comes just to a boil, remove from the heat. Add the crushed coffee beans to the milk, place a lid on the pot, and leave to infuse for 20-minutes. Strain the milk through a fine-mesh sieve and discard the coffee beans. Weigh the milk to make sure you have enough & top up whatever you need to. Set aside.
Set up a fine-mesh sieve over a medium sized bowl in an ice-bath, this needs to be ready before proceeding. Have your digital thermometer at the ready.
Combine the remaining half of the sugar with the egg yolks & cornflour in a medium bowl. Whisk until slightly paler in colour. Be careful not to leave the sugar sitting on top of the yolks for too long before whisking as they'll get hard and become unusable.
Place the coffee flavoured milk back on the stove and heat to just a boil. Pour 1/3 of the hot milk into the yolk mixture, whisking constantly. Pour the milk-yolk mixture back into the pot & cook over a medium-low heat, whisking constantly (!), until the mixture is thick & reads at least 82°C on a digital thermometer. Remove from heat, add the butter & vanilla extract & whisk to combine. Strain the cream through the sieve into the bowl set over the ice-bath.
Cool the pastry cream to room temperature, then place a piece of plastic wrap directly on the surface to prevent a skin from forming & refrigerate until needed.