In April/May 2020 Youtube released video chapters feature. Chapters are parts of the Youtube video, which are created by timestamps in description.
This code enables users to go to the next chapter by pressing 'n' key on the keyboard. And go to the previous chapter by pressing 'p' key.
To use this code you need to install a Tempermonkey extention and put the code there. Enable the tampermonkey extention when you visit Youtube.