Cook the elbow macaroni according to package instructions until al dente. Drain and set aside.
In a large pot, melt the butter over medium heat. Once melted, whisk in the flour and cook for about 1 minute until bubbly.
Gradually whisk in the whole milk, stirring continuously until the mixture thickens and begins to bubble, about 5-7 minutes.
Stir in the garlic powder, onion powder, Dijon mustard, salt, black pepper, and cayenne pepper (if using).
Remove the pot from heat and gradually add the shredded cheddar and mozzarella cheeses, stirring until fully melted and smooth.
Add the cooked macaroni to the cheese sauce and stir until well combined.
For an extra creamy texture, let the mac and cheese sit for about 5 minutes before serving.