Preheat your oven to 350°F.
In a large skillet, melt 2 tablespoons of butter over medium heat. Add the sliced squash, diced onion, and minced garlic. Sauté for 8-10 minutes until tender, then drain excess liquid.
In a large bowl, combine ¼ cup sour cream, ½ cup mayonnaise, the beaten egg, 1 cup shredded cheddar, salt, and pepper. Mix well.
Stir in the sautéed squash and onion mixture into the creamy blend.
Pour the mixture into a greased 8x8-inch baking dish. Spread it out evenly.
Melt the remaining 2 tablespoons of butter. Combine it with the crushed Ritz crackers and the remaining 1 cup of cheddar cheese.
Sprinkle the cracker and cheese mixture over the casserole. Bake for 25-30 minutes until golden brown and bubbly.
Let cool for 5-10 minutes before serving.