In a large stockpot or dutch oven over medium-low heat, melt the butter. Add the onions, carrot, celery, and garlic and cook until the onions are translucent, stirring occasionally for about 5 minutes.
Add the flour to the pot and stir it in to coat the veggies, let cook for two minutes stirring constantly. Slowly pour in the chicken stock while stirring constantly to avoid lumps. Add the diced ham, potatoes, salt, and pepper to the pot and stir them in, making sure the potatoes are fully submerged. Bring to a boil, reduce heat to low, cover and simmer for 20-25 minutes or until the potatoes are cooked through.
Stir in the heavy cream, sour cream, and cheddar cheese. Continue to cook until the cheese is fully melted. Taste and adjust seasoning if necessary. Take off the heat and serve with more cheese, and scallion for garnish, optional.