To configure gpio as input and output, where should I update my Debian image?

In the Beaglebone Black(debian image 4.19), I need to fix a few GPIO pins for input and output.In order to do this, how can I modify my kernel?

why do you want to modify the kernel,
It is recommended to update the image as it more optimised then the prior version.
Even if you’re using older or latest image of Debian, you can create a char driver instead of modifying the kernel

i need 8gpio pin as digital input and 8gpio pin as digital output forever

That shouldn’t be a problem for beaglebone black