There’s not a lot of magic to controlling the GPIO on the Beagle Bone Black, it’s actually the same as other embedded linux boards like the Raspberry Pi. What actually is the confusing part is knowing which pin from the header actually maps to which pin number in code. As odd as it seems it’s not very straight forward mapping, pin 10 isn’t pin 10. There is a GPIO interface manual you will need to consult. After that everything is available through the sysfs interface.
If you need a refresher or want to find out more about mapping the gpio, check out this tutorial. While you’re diggin around in the sysfs interface, there are other goodies in there such as setting pin mux and what not, but that’s another tutorial :)