Preheat the oven to 350F. Line a baking sheet with parchment paper.
Beat butter and granulated sugar until fully creamy and incorporated.
Add in the egg yolk and mix well.
Mix in vanilla extract.
Add in flour and mix using a wooden spoon or spatula until a dough forms.
Roll a 1-inch ball of dough and set it aside. Repeat with the remaining dough until you have 36 dough balls.
Roll each ball in the beaten egg and then in the coconut flakes (optional step).
Place the balls on the baking sheet, leaving a 2-inch space between them.
Using your thumb, press an indentation into the center of each cookie. Fill the indentation with raspberry jam.
Bake the cookies in the oven for 9-10 minutes until the bottom of the cookies is golden.
Cool the cookies on a rack and then serve.