Place the beans in a colander and sort out any debris, rinse beans and add to the pressure cooker.
Then continue to place all of your ingredients into your instant pot bowl in the following order: Beans, chopped onion, corn with juice, tomatoes with juice, water, and chicken broth.
Add chili powder, cumin, ranch, and ham flavor packet from beans. Stir everything to combine.
Place lid on instant pot, set vent to sealing, and use manual high pressure, and cook for 20 minutes.
Let pressure release naturally for 10 minutes, then release remaining pressure by switching the valve to the "venting" position to completely release steam before opening the lid.
Open the lid, and add the chicken to the pot, pushing it down into the liquid.
Cut cream cheese into 6-8 pieces and place over the top of the rest of the chili ingredients. Cover and seal with lid, switch the valve back to the "sealing" position and cook for 20 min on manual high pressure. Once it is done cooking, let it naturally depressurize for 10 min then switch the valve to the "venting" position to completely release steam before opening the lid.
Remove the chicken to a plate and shred apart with 2 forks. Check the doneness of the beans. If they need more time, add 5-10 more minutes.
Stir everything together in the pot to melt the cream cheese into the chili then return the shredded chicken and stir to combine. Serve garnished with avocado and cilantro if desired.