Make the crust – Mix graham cracker crumbs, melted butter, and sugar. Press into a 9-inch pie dish to form a firm layer. Chill while you make the filling.
Prepare the coconut filling – In a medium saucepan, whisk together sugar and cornstarch. Slowly add coconut milk and heavy cream, stirring constantly.
Cook the custard – Heat over medium heat, whisking continuously until the mixture thickens and bubbles.
Temper the egg yolks – Slowly whisk in a few spoonfuls of the hot mixture into the egg yolks to prevent curdling, then combine everything back in the pan.
Finish the custard – Cook for another 2 minutes until thickened. Stir in vanilla and optional coconut extract.
Assemble the pie – Pour the coconut custard over the chilled crust. Smooth the top with a spatula.
Chill – Refrigerate at least 4 hours or overnight until fully set.
Garnish and serve – Top with whipped cream and toasted coconut just before serving.