In a saucepan on medium heat, combine granulated sugar, water, cornstarch and lemon juice. Whisk it constantly until it comes to a boil. It will thicken quickly, about 2-3 minutes.
Remove pan from the heat and stir in the peaches. Add the vanilla, cinnamon and nutmeg and stir to combine.
Let the filling cool completely. At that point you can add it to your prepared pie crust.
Notes
After filling cools completely, you can freeze the peach pie filling to bake with later. Go to my post about how to freeze your filling in a pie pan: https://thatbreadlady.com/freezer-peach-pie-filling/
Use this recipe with other fruits like apple, pear or strawberry. Switch up the spices to your preference.