You may already know something about the EM (electromagnetic) spectrum. The light we see is part of the EM spectrum. Radio waves, microwaves, and X-rays are part of it, too. Another part is called infrared. Like all parts of the EM spectrum, infrared is a kind of energy that moves in waves. Our eyes can't see infrared waves. We can't see radio, microwaves, or X-rays, either. Infrared waves act in the same ways that light does. Infrared is reflected, or bounces off, light things better than dark things. It is absorbed by dark things better than by light things. Light travels in a straight line and so do infrared waves.
Your TV remote sends out a beam of infrared waves. It sends out different codes for different commands. The TV set receives the beam. A microchip inside the TV "reads" the beam, much like your brain "reads" the signals sent to it by your eyes. The microchip tells the TV what you want it to do. The remote can tell it to turn the volume up or down. The remote can tell your TV to change channels.
Remotes can send messages to your TV in a straight line. You can't use the remote in another room and get the TV to do what you want. You can't stand between a person using the remote and the TV. You must point the remote at the TV and not be too far away, and you must not block the infrared beam.