Cook the macaroni according to package instructions until al dente, then drain.
In a large saucepan, melt butter over medium heat and whisk in the flour, cooking for about 2 minutes.
Gradually whisk in the milk, stirring constantly until the mixture thickens.
Add garlic powder, mustard powder, salt, and pepper to the thickened milk mixture.
Remove from heat and add the shredded cheddar cheese, stirring until fully melted.
Combine the cooked macaroni with the cheese sauce, mixing well.
If the sauce is too thick, add a bit of reserved pasta water to loosen it.
Transfer the mixture to a greased baking dish if you prefer baked mac and cheese.
(Optional) Top with additional cheese or breadcrumbs and bake at 350°F for 20-25 minutes.
Let it sit for a few minutes before serving, allowing the cheese sauce to set slightly.