Preheat the oven to 200ºC with heat up and down, and prepare a couple of trays with parchment paper. Make sure the butter is soft, not melted, and the egg is also at room temperature.
Beat the butter with a stand mixer, or with an electric mixer, together with the sugar, salt and optional vanilla, for several minutes until you obtain a homogeneous and fluffy cream.
Add the egg, beat a little more, and add the flour. Beat at low speed until incorporated and have a dough without lumps. If it is very hot and we want to stretch it, let it cool in the fridge for half an hour, although it is not necessary.
Fill a pastry bag with curly mouthpiece with the dough, or stretch to leave a thickness of 4 mm. You can also take balls of dough and form flattened balls, discs or whatever you want.
Distribute on trays slightly apart -not too much- and bake, one tray at a time, until the edges start to brown, about 6-9 minutes, depending on size. Wait a few moments out of the oven before letting cool on a wire rack.