Spread the dried beans out on a baking sheet or clean work surface and pick through them, removing any small stones, debris, or damaged beans.
Rinse the beans thoroughly under cool running water.
Add the beans to a large heavy pot or Dutch oven with 8 cups of water, the onion, and garlic.
Bring the pot to a boil, then reduce the heat to maintain a gentle simmer.
Partially cover the pot and cook until the beans begin to soften, checking occasionally to make sure they remain covered with liquid. Add hot water as necessary.
After about 1 hour, begin checking the beans periodically for tenderness. Cooking time can vary significantly depending on the variety and age of the beans.
Once the beans are mostly tender, add the epazote and salt.
Continue simmering until the beans are completely tender and creamy inside but still mostly intact. The cooking liquid should have developed into a flavorful, lightly thickened bean broth.
Remove the onion, garlic, and epazote stem if desired.
Taste the broth and adjust the salt.
Ladle the beans into bowls with plenty of their broth.
Serve simply or finish with chopped onion, cilantro, queso fresco, serrano, or lime according to your preference.