The code required for pairing Amazon Fire TV remote control with your display comes up after you connect both devices to the same Wi-Fi network, launch the downloaded app and select the device you wish to pair. When you do this, the code appears, and you enter it for pairing.
Before you can pair your chosen display with an Amazon Fire TV remote control, you must first download the Fire TV Remote app. This app works for Amazon Fire phones, Fire tablets, Android 4.0 and higher, and iOS 7.0 and higher. This app also works with version 1.41 and higher of Amazon Fire TV and the Fire TV stick. Once you pair the Amazon Fire TV remote to your device, a factory reset is necessary for unpairing.