Prep the pan and oven: Heat your oven to 350°F (175°C). Line a 9x13-inch baking pan with parchment, leaving an overhang on the long sides for easy lifting.
Lightly grease the parchment.
Make the crust: In a bowl, whisk 2 cups all-purpose flour, 1/2 cup granulated sugar, and 1/2 teaspoon salt. Add 1 cup (2 sticks) melted unsalted butter and stir until the mixture looks like damp sand and holds when pressed.
Press and bake the crust: Press the mixture firmly into an even layer in the pan, getting into the corners. Use the bottom of a measuring cup to smooth.
Bake for 18–20 minutes, until the edges are lightly golden.
Whisk the lemon filling: While the crust bakes, whisk 1 1/2 cups granulated sugar, 1/4 cup all-purpose flour, and 2 tablespoons cornstarch in a large bowl. Add a pinch of salt. Whisk in 4 large eggs, 2/3 cup fresh lemon juice, 1 tablespoon finely grated lemon zest, 1 teaspoon vanilla extract (optional), and 1/3 cup heavy cream or whole milk until smooth.
Reduce oven temperature: After the crust comes out, lower the oven to 325°F (163°C).
This helps the filling set without over-browning.
Pour and bake: Pour the lemon filling over the hot crust. Return the pan to the oven and bake for 18–24 minutes, until the center is just set and no longer jiggly in waves when you gently shake the pan. A tiny wobble is okay.
Cool and chill: Let the bars cool in the pan on a rack until room temperature.
Then chill for at least 2 hours to firm up for neat slices.
Slice and finish: Lift the slab out using the parchment overhang. Dust with powdered sugar if you like. Use a sharp knife to cut into bars, wiping the blade between cuts for clean edges.