Cream the butter and sugars. In a large bowl, beat the softened butter, granulated sugar, and powdered sugar until light and fluffy, about 2 minutes.
Scrape the bowl as needed so everything blends evenly.
Add the egg and flavorings. Beat in the egg, vanilla, and almond extract (if using) until smooth. The mixture should look creamy, not curdled.
Combine the dry ingredients. In a separate bowl, whisk together the flour, cornstarch, and salt. Add to the butter mixture and mix on low just until a soft dough forms.
Do not overmix.
Chill the dough. Cover and refrigerate for 30–45 minutes. This firms the dough so the cookies hold their shape and bake with a tender crumb.
Preheat and prep. Heat your oven to 350°F (175°C). Line two baking sheets with parchment paper.
Shape the cookies. Scoop 1-tablespoon portions of dough and roll into smooth balls.
If you like, roll some in chopped nuts or coconut. Place on the prepared sheets, spacing about 2 inches apart.
Make the “thumbprint.” Use your thumb, knuckle, or the back of a 1/2-teaspoon measuring spoon to press a shallow well in the center of each ball. If the edges crack, pinch or smooth them gently.
Fill with jam. Stir the jam to loosen it.
Spoon about 1/2 teaspoon into each well, filling just shy of the rim so it doesn’t overflow during baking.
Bake. Bake 11–13 minutes, rotating the sheets halfway through. The cookies should look set with the bottoms just turning light golden. The jam will be bubbly but will set as it cools.
Cool completely. Let the cookies rest on the sheet for 5 minutes, then transfer to a wire rack to cool.
Dust with powdered sugar or drizzle with a simple glaze once cooled, if you like.