Boil the beans in plenty of water, together with 2 bay leaves, 1 whole onion and 2-3 tbsp oil. Cook over low heat, with no salt and, if it needs more, add only hot boiling water. Otherwise, the beans will harden and won't be so tasty.
When beans are soft, remove the onion, the bay leaves, drain the broth (but don't discard it).
I used brown speckled beans, that was what I had in the kitchen and they were very good.