Dried beans are a valuable ingredient and a staple of many cuisines. They are both nutritious and affordable. Trouble is, a good portion of bean varieties require specific methods and know-how to cook properly; namely, they are tricky to cook thoroughly and likely to remain hard even after boiling on the stove for long periods of time. They aren't like pasta or steak in the sense that you can simply throw them in or on some heat and they will be done in half an hour. Discerning shopping habits and careful preparation will ensure beans become soft.
You must presoak most varieties of dried beans for them to cook all the way through in a reasonable amount of time. There are exceptions -- lentils and split peas, for example. But for the most part, you need to prepare the beans beforehand by soaking them for at least four hours prior to cooking. Trouble is, some people view this as an optional, "good to know" step, but it is in fact necessary.
Dried beans aren't typically viewed as perishables in a traditional sense; they won't go bad after a few weeks or months. However, just because they won't make you sick doesn't mean that they will cook properly. Most beans cook better and more consistently if they are less than a year old. Granted, there's no easy, universal way to confirm their age in your produce aisle, but asking your grocer will give you a good idea.
In addition to age, heat and light have negative effects on beans. The less you know about the source of the beans, then the greater the chance that you will buy defective ones that will stubbornly remain hard during cooking thanks to too much heat and light during storage. Farmer's markets are good for combating this. Also, once you've purchased the beans, the rules still apply; keep them in a cool, dark place.
Some beans cook better when they are slow cooked. Even if they are adequately presoaked, simply boiling them won't do. Black-eyed peas, kidney beans and pinto beans are a few examples that need both presoaking and slow cooking. Cover the beans in water in a pot and bring to a boil. Take the foam off the top, then let simmer. Cooking time varies depending on the bean; begin to test the beans after an hour or so.