Sort the beans, discarding any stones, dirt, or broken beans. Rinse the beans. If you want to, do an overnight or quick soak.
Cover the beans with 8 cups of water and sprinkle with the 2 teaspoons of salt. Leave the beans to soak at least 8 hours, or overnight.
Put the beans, 8 cups of water, and 2 teaspoons of salt in an Instant Pot or other pressure cooker. Pressure cook at high pressure for 1 minute (“Manual” or “Pressure Cook” mode in an Instant Pot), Quick Release the pressure, then let the beans sit for 30 minutes.
Drain the beans, discarding the soaking liquid. Put the beans in the pressure cooker, add 6 cups of water, sprinkle with the teaspoon of salt, then add the onion halves and bay leaf. Lock the lid and pressure cook at high pressure: 10 minutes for soaked beans, or 25 minutes for unsoaked beans. (In a stovetop PC, cook for 8 minutes soaked/20 minutes unsoaked). For soaked beans you can quick release the pressure, or let the pressure naturally release. For unsoaked beans, don't quick release - let the pressure come down naturally. (If you're in a hurry, you can stop the natural pressure release after 15 minutes by quick releasing any remaining pressure.)
Discard the onion and bay leaf. To use as a side dish, serve the beans with their broth; to add to another recipe, drain the beans. Enjoy!
