Melt 2 tablespoons of butter in a medium skillet over medium-low heat. Add the sliced squash and chopped onion, cooking until tender and fragrant, about 5 to 7 minutes.
In a large bowl, crack the eggs and lightly whisk them. Add the grated cheddar cheese and milk, whisking until smooth.
Add the cooked squash and onion mixture to the egg mixture. Stir until well combined.
Melt the remaining 2 tablespoons of butter in the same skillet. Pour this into the squash mixture, adding cayenne pepper, kosher salt, and black pepper. Stir well.
Spray a 9×13 casserole dish with cooking spray. Pour the mixture into the dish and spread evenly.
Sprinkle the crushed Ritz crackers evenly over the top.
Bake for 45 minutes until the top is lightly browned and the casserole doesn’t jiggle when moved.
Allow to sit for about 3 minutes before serving.
Notes
Use fresh yellow squash for better flavor and texture.
Sauté vegetables just until tender to prevent mushiness.
You can prepare the casserole a day in advance and bake it the next day.