Preheat oven to 375°F, blind bake pie crust with weights for 15 minutes, then remove weights and bake 5-7 more minutes until golden.
Whisk sugar, cornstarch, and salt in a saucepan. Add milk gradually and cook over medium heat, stirring constantly.
Remove 1 cup of the hot mixture and slowly whisk it into beaten egg yolks, then return everything to the pan and cook until thick.
Remove from heat, stir in butter, coconut flakes, and vanilla extract, then pour into baked crust.
Beat egg whites with cream of tartar until foamy, gradually add sugar, and beat until stiff peaks form.
Spread meringue over hot filling, ensuring it touches the crust edges to prevent shrinking.
Bake at 350°F for 12-15 minutes until golden brown.
Let the pie cool for at least 2 hours before slicing.