If using frozen tater tots or hashbrowns, take them out of the freezer and arrange them in a single layer on a baking sheet to thaw while you prep the rest of the casserole.You don't need to bake them, but they shouldn't be frozen solid when you put the casserole in the oven.
Preheat Oven
Preheat the oven to 400ºF.
Make Sauce
Heat butter in a large skillet over medium-high heat. Add onions and 1/2 tsp salt and stir until onions soften, about 6 minutes. Add the garlic and cook for 1 minute more.
Sprinkle flour over the onion mixture. Cook, stirring constantly, for about 2 minutes. The flour should lose it’s raw taste but not start to brown.
Whisk in the chicken broth, 1/2 cup at a time, to prevent lumps. Allow the mixture to come to a boil and thicken.
Once the sauce is bubbly and thick, turn off the heat.
In a separate bowl, whisk together the sour cream and mayonnaise. Drizzle ½ cup of the sauce into the sour cream mixture, whisking until the mixture is smooth. Add it back to the skillet.
Season with pepper and more salt as needed.
Gently stir in the peas, chicken and most of the tater tots (or other potato option). Reserve about 1/4 for the topping.
Transfer the mixture to a greased 9×13-inch baking dish. Top with grated cheddar cheese. Arrange remaining tater tots in a single layer on top of the chicken mixture.
Bake until bubbly and golden, about 20 minutes. Let it cool for a few minutes to thicken up before serving.