Prepare the Pie Crust
If you're using a store-bought pie crust, follow the instructions on the package to pre-bake it until golden. If you’re using homemade dough, roll it out, place it into a 9-inch pie dish, and bake it at 350°F (175°C) for about 10-12 minutes. Set aside to cool.
Make the Lemon Filling
In a medium saucepan, whisk together the sugar, cornstarch, and salt. Gradually stir in the water and cook over medium heat, whisking constantly until the mixture comes to a boil and thickens (about 5-7 minutes). Once thickened, remove the saucepan from the heat.
Temper the Egg Yolks
In a separate bowl, whisk the egg yolks lightly. Slowly add a little of the hot sugar mixture to the yolks, whisking constantly to prevent the eggs from cooking. Gradually pour the tempered egg yolks into the saucepan with the remaining sugar mixture, whisking continuously. Return the saucepan to medium heat and cook for an additional 2 minutes until thickened.
Add Lemon and Butter
Remove the saucepan from heat. Stir in the lemon juice, lemon zest (if using), and butter until the butter is melted and the filling is smooth. Pour the lemon filling into the pre-baked pie crust.
Prepare the Meringue
In a clean mixing bowl, beat the egg whites and cream of tartar with an electric mixer until soft peaks form. Gradually add sugar, about a tablespoon at a time, until stiff peaks form and the meringue is glossy. Add vanilla extract and beat for a few more seconds.
Top the Pie with Meringue
Spread the meringue over the lemon filling, making sure to seal the edges of the crust to prevent shrinking. Use a spatula to create peaks on the meringue.
Bake the Pie
Bake the pie in the preheated oven at 350°F (175°C) for about 10-12 minutes or until the meringue is golden brown.
Cool and Serve
Let the pie cool to room temperature for at least 2 hours to allow the filling to set properly. For the best texture, refrigerate for an additional hour before serving.