Add dry beans, salt, pepper and 3 cups of water or broth to the Instant Pot. Cook on High Pressure for 30 minutes. Allow the cooker to naturally release pressure (about 30 minutes).
Drain the beans in a colander and rinse under cold water. Clean the pot and return it to the machine.
To Make the Baked Beans
Turn the Instant Pot on Saute. Add 1 tsp cooking oil. Add the bacon and the onion and allow them to saute for about 3-4 minutes, stirring occasionally so it doesn’t burn. Add the garlic. Cook for 1 more minute. Turn off the Instant Pot.
Add the cooked beans to the Instant Pot with the rest of the ingredients. Stir to combine. Put on the lid and make sure the valve points to sealing.
Cook on high pressure for 10 minutes followed by a 10-minute natural pressure release. After 10 minutes, manually release the rest of the pressure and remove the lid.
Serve with green onions and/or fried onions on top, if desired.