Infuse the Milk: In a saucepan, combine the milk and ground coffee. Heat over medium heat until it simmers. Remove from heat and let it steep for 30 minutes.
Whisk the Yolks and Sugar: In a separate bowl, whisk together the egg yolks and sugar until creamy and slightly pale.
Combine Mixtures: Reheat the coffee-infused milk and gradually pour it into the egg yolk mixture, whisking continuously. Return the combined mixture to the saucepan.
Cook the Custard: Cook the mixture over low heat, stirring constantly, until it thickens and coats the back of a spoon. Do not let it boil.
Strain and Chill: Strain the custard through a fine-mesh strainer into a bowl. Stir in the heavy cream and vanilla extract. Chill the mixture for at least four hours or overnight.
Churn in Ice Cream Maker: Pour the chilled mixture into an ice cream maker and churn according to the manufacturer's instructions.
Freeze: Transfer the churned gelato into a lidded container and freeze for a few hours until it reaches the desired consistency.