In a large pot or Dutch oven, melt the butter over medium heat. Add the finely chopped onion and minced garlic. Sauté for about 2-3 minutes, or until the onion becomes translucent and the garlic is fragrant. Stir occasionally to prevent burning.
Sprinkle the all-purpose flour over the sautéed onions and garlic. Stir continuously with a wooden spoon or whisk to combine, creating a roux. Cook for 1-2 minutes until the roux turns a light golden brown. This step helps to eliminate the raw flour taste and develops flavor.
Slowly pour in the chicken or vegetable stock while whisking continuously to avoid lumps. Continue whisking until the mixture is smooth and starts to thicken, about 3-4 minutes.
Add the kosher salt, black pepper, and, if using, the paprika or ground nutmeg. Stir well to incorporate the seasonings into the soup base.
Add the broccoli pieces and grated carrot to the pot. Stir to combine. Bring the soup to a simmer and reduce the heat to medium-low. Cover and cook for about 15-20 minutes, or until the broccoli is tender but still vibrant in color. Stir occasionally to ensure even cooking.
Once the vegetables are tender, reduce the heat to low. Slowly stir in the heavy cream or half & half, followed by the shredded cheddar cheese. Continue stirring until the cheese is fully melted and the soup is creamy. Do not let the soup come to a boil after adding the dairy, as this could cause the cream to curdle.
Taste the soup and adjust the seasoning with more salt and pepper if needed. If you prefer a smoother texture, you can use an immersion blender to partially blend the soup, leaving some pieces of broccoli for texture.
Ladle the soup into bowls and garnish with additional shredded cheddar cheese, if desired. Serve warm with crusty bread or a side salad.