To prepare a yellow squash and corn casserole recipe, first cut the squash in half lengthwise and scoop out the seeds. Then cut each half into quarters and place them in the bottom of an 8 x 8-inch baking dish. Add the corn kernels, butter, sugar, salt, and pepper to taste. Pour the mixture into the dish and bake for 45 minutes at 325 degrees F. Remove the casserole from the oven and let it cool for 10 minutes before slicing it into squares.