In a large bowl, mix the flour, powdered sugar, and salt.
Add the cold butter cubes and rub them into the flour mixture with your fingers until it forms a crumbly texture.
Add the egg and mix until the dough comes together into a ball.
Wrap the dough in plastic wrap and chill in the fridge for 30 minutes.
Step 2: Roll Out & Pre-Bake the Crust
Roll out the chilled dough on a lightly floured surface until it fits a 9-inch tart pan.
Press the dough into the pan and prick the bottom with a fork.
Place the pan in the fridge while you prepare the custard.
Step 3: Prepare the Custard Filling
Slice the vanilla beans in half lengthwise and scrape out the seeds.
In a saucepan, heat the milk with the vanilla beans (or vanilla extract) over medium heat until it starts to simmer. Remove from heat and let the vanilla infuse for 10 minutes.
In a large mixing bowl, whisk together the eggs, sugar, and cornstarch until smooth.
Slowly pour the warm vanilla milk into the egg mixture, whisking continuously to prevent curdling.
Pour the mixture back into the saucepan and cook over medium heat, stirring constantly, until it thickens into a smooth custard.
Step 4: Assemble & Bake the Flan
Preheat your oven to 350°F (175°C).
Pour the custard into the chilled tart crust and smooth the surface with a spatula.
Bake for 40 minutes, until the top is golden brown and the center is just slightly wobbly.
Let the flan cool to room temperature, then refrigerate for at least 2 hours before serving.