Melt butter in a large pot or Dutch oven over medium heat. Add onion and cook, stirring often, for approximately 5 minutes (until soft). Stir in garlic and continue to cook for one another minute.
Whisk in flour and cook until golden, about 2 minutes.
Gradually whisk in milk and cook, whisking constantly, until slightly thickened, about 1-2 minutes.
Gradually pour in the chicken or vegetable broth and whisk until combined. Stir in potatoes and bring the mixture to a simmer.
Reduce heat and simmer for 15-20 minutes, or until potatoes are tender.
Using an immersion blender, or carefully transferring to a regular blender, blend the soup until smooth.
Stir in cheddar cheese and sour cream until melted and combined.
Cook bacon until crispy. Crumble and set aside.
Serve hot, garnished with crumbled bacon, corn, and green onions (optional).