Peel and cube potatoes into ½-inch pieces and submerge in cold water. Dice the onion, celery, and carrots; mince the garlic; and cube the ham into ½-inch pieces.
Melt butter in a large Dutch oven over medium heat, then add the onion, celery, and carrots. Cook for 4 to 5 minutes until softened, then add the minced garlic and stir for 30 to 60 seconds until fragrant.
Sprinkle the flour over the vegetables and stir constantly for 1 to 2 minutes until the flour coats everything and cooks out its raw taste.
Slowly pour in the chicken broth, about ½ cup at a time, stirring constantly to prevent lumps. Stir in the garlic powder, onion powder, smoked paprika, dried thyme, and a pinch of salt and pepper.
Drain the potatoes and add them to the pot along with the diced ham. Increase heat to medium-high and bring the soup to a gentle boil, stirring occasionally.
Reduce heat to medium-low and simmer uncovered for 15 to 20 minutes, stirring every few minutes, until the potatoes are completely fork-tender. Optionally, mash about a quarter of the potatoes in the pot to thicken the broth.
Reduce heat to low, pour in the milk while stirring, and warm for 3 to 5 minutes. If using cheddar, add it in batches, stirring after each addition until fully melted.
Taste and adjust seasoning with additional salt, pepper, or paprika as needed. Ladle into bowls and top with sour cream, green onions, and extra shredded cheddar.