Preheat oven to 350°F and grease an 8x8-inch baking dish with butter. Cut day-old bread into 1-inch cubes and spread evenly in the prepared dish.
6 cups bread, 2 tbsp butter
Whisk together eggs, milk, salt, and black pepper in a large bowl until smooth. Pour the custard over the bread cubes and press down firmly to ensure even soaking. Let stand for 10 minutes.
6 large eggs, 2 cups whole milk, 0.75 tsp salt, 0.5 tsp black pepper
Sauté diced onion in a skillet over medium heat for 5-7 minutes until translucent and softened. Stir the cooked onions and 1 cup of shredded cheese into the soaked bread mixture. Sprinkle the remaining ½ cup of cheese evenly on top.
1.5 cups shredded cheddar cheese, 1 medium onion
Bake on the middle rack for 40-45 minutes until the center is set and the edges are golden brown. The custard should jiggle slightly in the center but not appear wet.
Let the pudding rest for 10 minutes before cutting into squares. Optional: Broil for 2-3 minutes to crisp the top without burning the cheese.