Preheat oven to 375°F (190°C).
Melt butter in a large skillet over medium heat; add chopped onion and cook until softened, about 3-5 minutes.
Stir in flour and cook for 1 minute, stirring constantly to form a roux.
Gradually whisk in milk, stirring until mixture thickens and is smooth.
Add corn, squash, salt, and black pepper to the skillet; stir to combine.
Fold in 3/4 cup of shredded cheddar cheese.
Pour mixture into a 9x13 inch baking dish.
If desired, sprinkle remaining cheddar cheese and breadcrumbs evenly over the top.
Bake for 25-30 minutes until bubbly and lightly golden brown.
Let casserole stand for a few minutes before serving.