Beans are pulses like peas and lentils and like other pulses beans have plenty of protein. The protein in some cereal crops, notably wheat, rye and barley complements the protein in beans. Due to the high protein content beans are valuable for vegetarians and even more so for vegans.
Some beans can be harvested while they're still immature and green in the pod, then they're like other green vegetables but with more protein and aare called French beans. Mature beans are typically sold dried when you can soak them and boil them like other pulses, see cooking pulses. You can also get precooked beans and other pulses in tins but those you've cooked yourself are likely healthier and taste better.