Rinse navy beans and pick through the beans and discard any debris or beans that are shriveled or discolored.
Add the olive oil to the Instant Pot and press the SAUTE button. Change the heat to custom and adjust to MEDIUM heat. When the display reads "HOT add the onion, celery, and carrots. Cook for 10 minutes, stirring occasionally to keep the onions from sticking. When the onions are softened, add the minced garlic and heat for about 30 seconds. Press CANCEL on the Instant Pot.
Stir in the beans, chicken broth, water, thyme, rosemary, cayenne, cumin, bay leaves, and pepper. Add the diced ham and stir to combine. Put the lid on and lock it into place. Make sure the vent is sealed.
Press PRESSURE COOK. Select HIGH and adjust the time to 40 minutes.
Allow the steam pressure to naturally release for 15 minutes. Manually release any remaining pressure. Unlock and remove the lid. Discard the bay leaves. Use an immersion blender or potato masher and pulse/mash the beans about 3 times to help thicken the soup and make it creamier. Add salt.
Serve.