Add 1/2 tablespoon olive oil to a large, cast-iron pot over high heat. Once oil is shimmering, add chopped ham and sauté for 1–2 minutes until lightly browned. Remove to a paper-towel-lined plate. Quickly dry the pot and return to the stove top.
Over high heat, add the remaining 1/2 tablespoon olive oil and once shimmering, add the diced onion, heaping carrot, and heaping celery. Sauté for 4–5 minutes until onion is translucent. Add in garlic and stir for another minute.
Add the butter to the pot and stir until melted. Once melted, sprinkle in the flour. Stir for 1 minute to cook off the raw flavor of the flour. Add the seasonings: dried thyme, dried oregano, and cayenne pepper (if desired). Season to taste with salt and pepper. Stir seasonings for 30 seconds. Pour in 1 cup of milk and whisk until it starts to thicken (about 1 minute); then pour in the remaining 2 cups of milk. Whisk until it thickens (about 2–3 minutes), then add the chicken stock. Whisk until slightly thickened (another 1–2 minutes; see note 2).
Bring the soup to a boil, slightly lower heat to medium, and add the potatoes to the soup. Cook for 8–12 minutes, stirring often. The soup will thicken as it cooks, and the potatoes should be fork tender after 8–10 minutes. (If the soup has thickened too much, add a splash of additional chicken stock; I usually add up to 1/2 cup extra.)
Once potatoes are fork tender, stir in the corn and the ham you set aside earlier. Heat through. Decrease heat to low and add in the freshly shredded cheese. Stir until just melted, then taste for seasonings. Remove from heat.
Serve bowls of soup garnished with fresh thyme or parsley, if desired.
Notes
Note 1: Make sure to dice the potatoes into small pieces (1/2-inch) so they can cook through in 8–12 minutes. Larger potato chunks will need to simmer longer, which will result in too much liquid being absorbed.Note 2: As the soup simmers and thickens, be sure to stir it often and scrape the bottom as you stir. (The flour and butter have a tendency to stick to the bottom, which will result in a soup that doesn’t thicken properly.)Storage: I don’t recommend freezing Ham and Potato Soup due to its high dairy content. To reheat, gently warm the soup in a pot, stirring often. Avoid boiling or high heat to prevent separation of the ingredients.