In a large pot, melt the butter over medium heat. Add the diced onion and sauté until translucent, about 5 minutes. Stir in the minced garlic and cook for an additional minute until fragrant.
Add the broccoli florets and broth to the pot. Bring to a boil, then reduce the heat and let it simmer for about 15 minutes, or until the broccoli is tender.
Using an immersion blender, carefully blend the soup until smooth. If you prefer a chunkier texture, blend only half of the soup and leave the rest as is.
Stir in the whole milk and shredded cheddar cheese until melted and well combined. Season with salt, black pepper, and red pepper flakes if using.
If you prefer a thicker soup, stir in the cornstarch mixture and cook for an additional 2-3 minutes until the soup thickens.
Taste and adjust seasoning as needed before serving.