Toast the coconut: Spread the shredded coconut on a baking sheet. Bake at 325°F (165°C) for 5–7 minutes, stirring once, until light golden.
Watch closely—it can burn fast. Set aside to cool.
Bake the crust: If using a pastry crust, blind bake it with pie weights until golden and crisp. If using a graham cracker crust, bake for 8–10 minutes.
Let it cool completely.
Mix dry ingredients: In a medium saucepan off heat, whisk together sugar, cornstarch, and salt. This helps prevent lumps later.
Whisk in liquids: Add coconut milk and whole milk gradually, whisking until smooth. No lumps should remain.
Temper the eggs: In a separate bowl, whisk the egg yolks.
Bring the milk mixture to a gentle simmer over medium heat, whisking often. Once it thickens slightly, slowly whisk about 1/2 cup of the hot mixture into the yolks. Then pour the yolk mixture back into the saucepan, whisking constantly.
Cook until thick: Continue cooking over medium heat, stirring constantly, until the custard is thick and bubbling, about 2–4 minutes.
It should coat the back of a spoon and hold a line when you run your finger through it.
Finish the custard: Remove from heat. Whisk in butter and vanilla until smooth. Stir in 3/4 cup of the toasted coconut, reserving the rest for garnish.
Fill the crust: Pour the hot custard into the cooled crust.
Smooth the top. Press a piece of plastic wrap directly onto the surface to prevent a skin.
Chill: Refrigerate for at least 4 hours, or until fully set. Overnight is even better.
Whip the cream: Beat heavy cream, powdered sugar, and vanilla to soft peaks.
Remove plastic wrap and spread or pipe the whipped cream over the chilled pie.
Garnish and serve: Sprinkle the remaining toasted coconut on top. Slice with a sharp, clean knife. Wipe between cuts for neat slices.