Clean and rinse the yellow squash under cold running water. Then pat them dry with a paper towel to remove any excess moisture.
Using a sharp knife, slice the squash into half-inch slices.*Keep the slices uniform in size, so they cook at the same rate. Preheat the oven to 350 degrees
Place a large skillet or cast iron pan on the stovetop over medium heat.
Add 2 tablespoons of butter to the hot pan and stir until melted.
Add the chopped onions and sliced yellow squash to the pan.
Cook for about 5 minutes or until the onions and squash become slightly tender. Stir frequently so they don't burn.
Add the garlic, fresh thyme, to the pan and saute until the garlic becomes fragrant (1-2 minutes).
Remove the pan from the heat and, using a slotted spoon, remove the squash and onion mixture from the pan. Place the mixture on a paper towel-lined baking sheet to let it drain off the excess liquid and oil.
Set aside until needed, allowing it to cool. Do not tent the squash.
Add the salt, black pepper, beaten egg, sour cream, sharp cheddar cheese, and mayonnaise to a large mixing bowl
Whisk together to combine.
Add the squash to the sour cream mixture. Use a rubber spatula or a spoon to fold the ingredients together, fully coating the squash.
Lightly grease a medium baking dish, then add the squash mixture to the dish. Spread the mixture in an even layer.
Sprinkle the cracker crumb mixture in an even layer overtop of the squash mixture.
Place the baking dish on the center rack of the preheated oven and bake for 25-30 minutes until the casserole is bubbly and the cracker crust is golden brown.
Let the casserole sit for 5 minutes before serving.