In a large pot, melt the butter over medium heat. Add the onion and garlic and sauté until the onion is translucent, about 5 minutes.
Add the diced ham and potatoes to the pot and sauté for an additional 5 minutes.
Stir in the flour and cook for 1-2 minutes, until the flour is fully incorporated and has formed a paste.
Gradually add the chicken broth, stirring constantly to prevent lumps from forming. Bring the mixture to a boil, then reduce the heat to low and simmer for 20 minutes, or until the potatoes are tender.
Stir in the milk, heavy cream, salt, and pepper. Simmer for an additional 5 minutes, or until the soup is heated through.