Begin by soaking the navy beans. Place the rinsed beans in a large bowl and cover them with plenty of cold water. Let them soak overnight, or use the quick-soak method: cover beans with water, bring to a boil for 2 minutes, then let stand for 1 hour. Drain and rinse the beans thoroughly.
In a large pot or Dutch oven, combine the soaked and drained beans, 8 cups of water or broth, and the ham hock or ham bone. Bring to a boil over medium-high heat, then reduce the heat to low, cover, and simmer for about 1.5 to 2 hours, or until the beans are tender but not mushy. Skim off any foam that rises to the surface during the first hour of simmering.
While the beans are simmering, prepare your aromatics. In a separate skillet, heat a tablespoon of olive oil or use a bit of the rendered ham fat if available. Add the chopped onion, carrots, and celery. Sauté over medium heat until softened, about 8-10 minutes. Add the minced garlic and cook for another minute until fragrant.
Once the beans are tender, remove the ham hock/bone from the pot. Shred any meat from the bone, discarding excess fat and skin, and chop the meat into bite-sized pieces. Return the shredded ham to the pot.
Add the sautéed vegetables and garlic to the pot with the beans. Stir in the dried thyme, rosemary, and bay leaves. If using, add the red pepper flakes. Continue to simmer, uncovered, for another 30-45 minutes, allowing the flavors to meld and the soup to thicken slightly. Stir occasionally.
Season generously with salt and freshly ground black pepper to taste. Remember that the ham can be salty, so taste before adding too much salt. Remove the bay leaves before serving.
Ladle the hearty ham and beans into bowls. Garnish with fresh chopped parsley, if desired, for a pop of color and freshness.