Combine the flour, salt, butter, eggs, and sugar in a large bowl. Gradually add water and knead until the dough is smooth and soft.
Let the dough rest for 1 hour, covered.
Roll out the dough thinly and cut it into circles using a cup or cutter.
Add filling to one half of each circle, dampen the edges with water, fold, and seal with a fork.
For frying: Heat oil in a pan and fry pastelitos until golden brown. Drain on paper towels.
For baking: Preheat the oven to 350°F, brush pastelitos with egg wash, and bake for 20-25 minutes.