Peel, core, and dice the apples into small, even cubes or slices.
4 medium apples
In a large saucepan, melt the butter over medium heat. Add the apples, brown sugar, granulated sugar, cinnamon, nutmeg, and salt. Stir to coat.
1/4 cup brown sugar, 1/4 cup granulated sugar, 1 tsp ground cinnamon, 1/8 tsp ground nutmeg, 3 tbsp butter, 1/8 tsp salt
Add 2 tablespoons of the water. Cook for 8 to 10 minutes, stirring often, until the apples are soft but still hold their shape.
1/4 cup water
Whisk the cornstarch with the remaining 2 tablespoons of water until smooth. Stir it in right away and cook for 2 to 3 minutes, until thick and glossy.
1 tbsp cornstarch
Remove from the heat and stir in the vanilla. Let cool before using, since the filling keeps thickening as it cools.
2 tsp vanilla extract
Notes
Texture guide: Thick (with cornstarch) for pie, hand pies, stuffed donuts, and cake layers. Loose (skip the cornstarch) for yogurt, oatmeal, pancakes, waffles, and ice cream. Don't judge it hot: the filling firms up as it cools. Cool it completely before it goes into any crust or pastry. Storage: Airtight container in the fridge for up to 1 week. Freeze for up to a couple of months, then thaw overnight in the fridge.