Step 1: Cook the Macaroni: Bring a large pot of salted water to a boil. Add the elbow macaroni and cook according to package directions until al dente. Drain well and set aside. It is important not to overcook the macaroni, as it will continue to cook in the oven.
Step 2: Prepare the Cheese Sauce: In a large saucepan, melt the butter over medium heat. Whisk in the flour until smooth. Cook for 1-2 minutes, stirring constantly, to create a roux. Gradually whisk in the milk until smooth and free of lumps. Continue to cook, stirring constantly, until the sauce thickens slightly, about 5-7 minutes.
Step 3: Add the Cheese: Remove the saucepan from the heat. Stir in the salt, pepper, and 3 cups of the shredded cheddar cheese (reserve 1 cup for topping) and the Gruyere cheese, if using. Stir until the cheese is melted and the sauce is smooth and creamy.
Step 4: Combine Macaroni and Cheese Sauce: Add the cooked macaroni to the cheese sauce and stir until evenly coated. Ensure the macaroni is thoroughly mixed with the sauce.
Step 5: Transfer to Baking Dish: Pour the macaroni and cheese mixture into a greased 9x13 inch baking dish. Spread evenly.
Step 6: Add Topping (Optional): In a small bowl, combine the remaining 1 cup of shredded cheddar cheese with the bread crumbs (if using) and melted butter. Sprinkle evenly over the macaroni and cheese.
Step 7: Bake: Bake in a preheated oven at 350F (175C) for 20-25 minutes, or until golden brown and bubbly. The topping should be nicely browned and the cheese melted.
Step 8: Cool and Serve: Remove from the oven and let cool for a few minutes before serving. This allows the cheese sauce to set slightly, preventing it from being too runny.
Optional Tips: For a richer flavor, use a combination of sharp cheddar and mild cheddar cheese. To add a bit of spice, add a pinch of cayenne pepper to the cheese sauce. For a crispier topping, broil for the last 1-2 minutes of baking, watching carefully to prevent burning.