In a large pot, melt butter over medium heat. Add onion and cook until soft, about 3–4 minutes. Stir in garlic and cook for 30 seconds.
Sprinkle in flour and whisk continuously for 1–2 minutes to remove the raw flour taste.
Slowly whisk in chicken broth, then milk. Bring to a gentle simmer.
Add broccoli and shredded carrots. Simmer for 10–12 minutes, until broccoli is tender.
Lower heat and stir in cheddar cheese a handful at a time until melted and smooth. Season with salt and pepper.
Optional: Use an immersion blender for a smoother soup, or leave it chunky.