Master the technique of cooking dried beans with this basic recipe. The cooking time will vary based on the age and size of the beans, so begin to check for tenderness after 1 1/2 hours and continue cooking until the beans are tender.
Pick over and sort beans, then rinse under cold water and transfer to a large bowl. Add 3 quarts cold water, cover, and soak at room temperature for 8 to 24 hours.
Drain and rinse the beans; transfer to a large pot or Dutch oven and cover with at least 2 inches of water.
Stir in onion, garlic, bay leaves, and salt. Bring to a boil over high heat. Boil for 10 minutes. Reduce heat to medium-low and simmer until tender, 1 1/2 to 2 hours, stirring every 30 minutes.
Discard the onion pieces, garlic, and bay leaves. Using a slotted spoon, transfer the beans to a serving dish or storage container. (Reserve cooking liquid for soups or stews, if desired.)
To make ahead: Cooked beans will keep in the fridge for up to 1 week and in the freezer for up to 3 months.