A very simple example of controlling a LED button with libgpiod (v1.2) on Raspberry PI 4B. Tested on a Raspberry Pi 4B running Raspberry OS (buster). but it should work on other relatively new GPIO devices and other linux distributions as well.
sudo apt install libgpiod-dev build-essential
make