Summarize this article:

Most remotes come with batteries, but you may have to purchase your own. The battery type will be listed on the remote’s packaging.  Some universal remotes lose the programmed codes when both batteries are removed. When replacing batteries, do so one battery at a time. This ensures that there is a current running with just enough voltage to keep the stored codes from getting erased. If you’re worried you’ll forget and remove both batteries, use a label maker or paint marker to write a reminder on the inside of the battery cover. The packaging for your remote should explain how many devices (and which type) it can control. The manual for your universal remote will have even more detailed information on compatibility. This will probably be your television, but it can be any device. The packaging, as well as the owner’s manual, will detail how to enter your remote’s setup mode. Some universal remotes require a computer running specific software for setup. Others can be configured on the TV screen or on a smaller screen built right into the remote. Some universal remotes even come with smartphone apps.  You can enter setup mode in most universal remotes by pressing a button that says something like “setup” or a combination of two buttons (like On and Off at the same time). If you don’t have the manual, visit the manufacturer’s website and search for one to download. For example, if you’re programming your remote to turn on your television, press the button on your remote that says “TV.” Depending on your remote, you may need to hold down the button for a few moments. Each device has its own code which needs to be programmed into the remote. These codes are located in the universal remote’s manual, but some remotes have internal lists that can be accessed from the setup screen. Since these codes vary across remotes, you’ll need to use the ones that work with your specific remote.  There are websites which contain links to various manufacturer’s codes. You can find them by searching for the manufacturer and model of your remote along with the word “codes.” Typically, you’ll have to type in a numeric code and wait a few moments before receiving a screen confirmation or LEDs flashing in a certain pattern. Some remotes have a feature called Learning Mode which doesn’t require entering codes. If your device can “learn” and your other devices have remote controls, you can point the two devices at one another and use a key combination to force your universal remote to emulate the original. See your manual for information on how to start Learning Mode. Turn on the next component and re-enter setup mode in your universal remote. Press the button representing the component on your remote and enter its code. You never know when you’ll need it.
Put batteries into the universal remote. Find out which of your devices will be compatible. Turn on the first component you want to set up. Enter the universal remote’s setup mode. Press the key on your remote that corresponds with the device. Program the code for the device into the remote. Repeat the process for your other devices. Store your manual in a safe place.