Bring a large pot of salted water to a boil. Add the pasta and cook just until al dente, about 8 minutes. Drain the pasta and set aside.: The moment the water hits a rolling boil you will smell the minerality that salt adds, and that scent tells you the water is ready. Use plenty of water so the macaroni can move freely, which prevents sticking and ensures even cooking. A common mistake is under-salting the water; it should taste like the sea. If you skimp on salt here, the whole dish will be bland because the pasta itself needs seasoning. Watch for a vigorous boil, and add the pasta immediately to maintain temperature.
In a large pot, melt the butter over medium heat. Reduce the heat to low and whisk in the flour to create a paste. Add the milk and whisk until smooth. Increase the heat to medium and continue whisking until the sauce starts to thicken, about 2 minutes. Stir in the shredded cheese and continue stirring until the cheese is melted and the sauce is smooth. Fold in the pesto.: When the pasta hits the water you will hear a rapid, soft bubbling as the starches begin to release. Stir gently a few times in the first minute to prevent clumping. Al dente means tender but still slightly firm at the center; you should feel a tiny bite when you chew. Overcooking will make the final dish mushy because the pasta will continue to absorb sauce. Test a piece a minute or two before the suggested time so you catch the perfect texture.
Add the pasta, stirring to combine, and cook just until the pasta is warmed through. Season with salt and pepper to taste. Serve immediately.: The drained macaroni should steam briefly in the colander, with a light whiff of cooked wheat and starch. Shake gently to remove excess water, but do not rinse, because you want the surface starch to help the sauce adhere. Rinsing is a common misstep that leaves the pasta slippery and prevents the sauce from sticking. Transfer the pasta to a warm bowl so it stays hot while you finish the sauce, which helps the final meld.
In a large pot, melt the butter over medium heat: As the butter melts you will hear a soft hiss and notice a nutty aroma developing if it warms long enough. The butter should be fully liquid but not browned, because browning changes the flavor profile. Use moderate heat to control the process, since too high heat can scorch the butter and introduce a bitter note. Keep an eye on the pot and swirl the butter until glossy.
Reduce the heat to low and whisk in the flour to create a paste: When you add the flour to the melted butter you will see it turn into a smooth, pale paste, the roux. Whisk continuously to eliminate lumps and cook off the raw flour taste; you should smell a faint toasted, bready scent after a minute. If you leave it uncooked the sauce may taste pasty. Stir for the recommended time to ensure a silky base for the milk.
Add the milk and whisk until smooth: Pouring the room temperature milk in slowly while whisking creates a glossy, lump free béchamel. You will see the mixture transform from a paste into a liquid that gradually thickens. If you add the milk too quickly you risk lumps forming; temper carefully and whisk vigorously. The sauce should look smooth and velvety before you increase the heat.
Increase the heat to medium and continue whisking until the sauce starts to thicken, about 2 minutes: As the sauce warms, you will notice it cling to the whisk and coat the back of a spoon, that is the visual cue it is thickening. The aroma becomes richer, and the sauce will take on a slightly glossy sheen. If the heat is too low it will take much longer to thicken, if it is too high the sauce can scald. Keep whisking to avoid scorching at the bottom and to ensure even thickening.
Stir in the shredded cheese and continue stirring until the cheese is melted and the sauce is smooth: Adding the shredded Havarti should immediately mellow into the warm sauce, releasing a creamy, milky scent. Stir patiently until every shred is incorporated and the sauce becomes silk like and glossy. A common error is adding cheese to excessively hot sauce which can cause the cheese to separate or become grainy; remove from high heat and stir gently to melt evenly.
Fold in the pesto: When you stir in the pesto you will see a bright green ribbon weave through the pale sauce and smell basil and garlic lift the whole pot. Folding rather than vigorously whisking preserves some texture and prevents over emulsion. If the pesto is stirred in while the sauce is too hot, its fresh flavors may dull; add it off the highest heat and taste to control intensity.
Add the pasta, stirring to combine, and cook just until the pasta is warmed through: As the macaroni meets the sauce you will hear a soft bubbling and see the pasta become glossy and coated. Stir gently so every piece is enveloped in sauce, and cook only until the center of the pasta is warmed, which prevents over softening. Overcooking at this stage robs the dish of texture, so keep the time short and precise. The finished plate should glisten with sauce clinging to each curve.
Season with salt and pepper to taste: Taste the finished dish and adjust with kosher salt and freshly ground black pepper slowly, because the cheese and pesto already contribute salt. Add small increments and re taste, watching how each addition changes the balance. Oversalting is easy at this stage, so proceed carefully; if you go too far, dilute slightly with a splash of warm milk .
Serve immediately: Once plated, the sauce should still be warm and silky with a gentle steam rising, and the aroma of basil and melted Havarti inviting the first bite. Serving right away preserves the ideal texture and temperature. If you let it sit too long, the sauce will thicken and the pasta will continue to absorb moisture, which dulls the luscious mouthfeel. Plate generously and enjoy while warm.