navigate with arrows

I would like navigate between the images with the keyboard arrows but I don't know exactly where insert my function and my event listener. After solve it I can test.