Pick through the beans and discard all stones and broken beans.
Soak the beans in water overnight, making sure that there is enough water to fully cover. The longer you soak them, the shorter the cooking time will be.
Drain, rinse, and then transfer to a large pot.
Add enough water or stock so that the liquid is about 1 ½ inches above the beans.
Add in any seasonings (but not salt). I like to add garlic, bay leaves, and sliced onions.
Bring to the boil, then simmer partially uncovered for 1-3 hours, depending on how firm or soft you want your beans.
Add in the salt after about 1 hour of simmering time.
If the cooking liquid dries out before the beans are done, just add more.
Once done, drain the beans and serve. You can reserve the cooking liquid and use it to cook rice or to add flavor to soups and stews.
Notes
You can add much more flavor to the beans when you cook them from scratch.
Adding salt to the beans at the start slows down the softening process, so it is worth adding it in after about an hour of cooking.
Reserve the cooking liquid and use it to cook a divine-tasting treat.
Oh, and you can easily cook more beans than you need and store them in the fridge. They keep this way for about 5 days without any problem.