You can use a supported TV or receiver remote, a network-based remote for home-control systems or an infrared remote (commonly known as a universal remote) to control Apple TV.
If your TV or receiver supports HDMI-CEC, Apple TV uses the HDMI connection to allow it to be controlled by your TV or receiver remote. For more information, see the Apple Support article on Apple TV.
Go to Remotes and Devices, then choose Learn Remote and follow the onscreen instructions.
Note: Another option for programming some universal remotes is to enter a configuration code for Apple TV. Check the documentation that comes with your device.