Preheat your oven to 350°F (175°C). Ensure your pie crust is pre-baked and cooled.
In a large bowl, whisk together the granulated sugar and all-purpose flour. This helps prevent lumps.
Add the cream of coconut to the dry ingredients and whisk until smooth.
In a separate small bowl, lightly beat the egg yolks. Gradually whisk the egg yolks into the cream of coconut mixture.
Transfer the mixture to a medium saucepan. Cook over medium-low heat, stirring constantly with a whisk, until the mixture thickens enough to coat the back of a spoon, about 8-10 minutes. Do not boil.
Remove the saucepan from the heat. Stir in the cubed butter, vanilla extract, and a pinch of salt until the butter is fully melted and incorporated.
Pour the warm filling into the pre-baked pie crust. Smooth the top with a spatula.
Bake for 20-25 minutes, or until the filling is set and no longer jiggly in the center. A toothpick inserted near the center should come out clean.
Let the pie cool completely on a wire rack for at least 2-3 hours before chilling. This allows the filling to fully set.
Once cooled, cover the pie loosely with plastic wrap and refrigerate for at least 4 hours, or preferably overnight, to ensure it's thoroughly chilled and firm.