If using dried navy beans, soak them overnight in water, then drain and rinse.
In a large pot, heat olive oil over medium heat. Add onions, carrots, and celery, and sauté until softened (about 5 minutes).
Add garlic and cook for another minute until fragrant.
Pour in the broth, then add navy beans, thyme, bay leaf, and the ham hock (if using).
Bring the mixture to a boil, then reduce heat and let it simmer for 1 to 1.5 hours, or until the beans are tender.
Remove the bay leaf and ham hock. If you prefer a creamier texture, blend a portion of the soup using an immersion blender.
Season with salt and pepper to taste. Serve warm with crusty bread.