In a dutch oven or large pot, over medium-high heat, melt butter.
Add onion, celery, carrots, and ham; cook for approximately 5 minutes, or until onion is soft and ham begins to brown.
Stir in minced garlic and cook for about a minute.
Add flour and stir for about a minute, or until well blended.
Add broth and stir; let cook until thickened and bubbly.
Add potatoes; bring to a simmer. Reduce heat to medium-low, cover, and cook for 15 minutes, or until potatoes are tender.
Add cream (or milk), red pepper flakes (if desired), and black pepper; cook for 2 minutes.
Stir in cheese and sour cream until well blended.
Garnish with sour cream, cheese, and chopped ham.