Classic Tater Tot Hotdish

1/2 cup unsalted butter, divided
2 carrots, finely chopped
2 stalks celery, finely chopped
1 large onion, finely chopped, divided
kosher salt
3/4 cup all-purpose flour
3 cups whole milk
2 tablespoons chicken, vegetable or beef soup mix
freshly ground black pepper
2¼ pounds ground beef
9 ounces frozen peas or corn
1½ pounds Tater Tots
shredded cheese (optional)
chopped parsley, for garnishing (optional)
ketchup, for serving

Preheat the oven to 400 F.
In a large pot, melt 6 tablespoons of butter over medium-high heat. Add the carrots, celery, half of the onion and a pinch of salt, and cook, stirring, until soft, about 12-15 minutes.
Stir in the flour and cook for another minute. Stir in half of the milk and cook, stirring, until thickened. Stir in the remaining milk and cook, stirring, until very thick. Add the soup mix, a bunch of turns of black pepper and a teaspoon of salt. Taste and adjust seasoning as desired. Pour into a heat-safe bowl and set aside.
Wipe out your pot and set it back over medium high heat. Melt the remaining 2 tablespoons of butter and add the remaining half of the onion and a pinch of salt. Cook, stirring, until soft, about 5-7 minutes. Add the ground beef and cook, breaking up with a wooden spoon, until browned. Season with salt and pepper. Stir in the peas or corn.
Using a slotted spoon to drain the juices, transfer half of the beef mixture to a 4-quart casserole dish and spread it out evenly. Layer on half of the soup mixture, and then the other half of the beef and the other half of the soup. Cover with perfect rows and columns of Tater Tots. Sprinkle with another pinch of salt and pepper and top with cheese, if desired.
Bake until the tots are golden brown and crispy on top, about 45 minutes. Let cool slightly, top with p*Classic Tater Tot Hotdish**arsley if desired and serve with ketchup.