Combine the flour, cornstarch, and salt in a medium mixing bowl. Whisk them together and set aside.
In a large bowl, use an electric mixer to beat the softened butter and granulated sugar until the mixture is light and fluffy (about 2-3 minutes).
Mix in the egg yolks one at a time, ensuring each is fully combined before adding the next. Then, stir in the vanilla extract.
Gradually add the dry ingredients to the wet mixture, mixing just until a soft, smooth dough forms. Avoid overmixing. Shape the dough into a disk, wrap it snugly in plastic wrap, and refrigerate for at least 30 minutes to make shaping easier.
While the dough chills, preheat your oven to 350°F (175°C). Line two baking sheets with parchment paper.
Take the chilled dough and roll it into small balls, approximately 1 tablespoon each. Gently flatten each ball, then use a small heart-shaped cookie cutter to create the cookie shapes.
Using your thumb or the back of a small spoon, carefully press a small heart-shaped indentation into the center of each cookie.
Spoon a small dab of strawberry or raspberry jam into each indentation, being careful not to overfill.
Place the cookies on the prepared baking sheets, leaving about 1 inch of space between each. Bake for 12-15 minutes, or until the edges are light golden.
Let the cookies cool on the baking sheet for 5 minutes before carefully transferring them to a wire rack to cool completely.