Generally, infrared is a color of light invisible to the human eye. It has a wave frequency just lower than red, the lowest-frequency light that humans can see. Hence the name; "infra-red" means "below red". By contrast, ultraviolet is the invisible color just above what humans can see.
In phones, infrared relates to several distinct technologies.
Some phone cameras have dedicated sensors that measure infrared light in order to produce better photos in the visible light range. Camera sensor lenses may also include filters that specifically block infrared light, again to produce better photos.
Infrared can also refer to a line-of-sight wireless technology that uses a beam of invisible light to transmit information. This means that the infrared ports of both devices must be somewhat aimed at each other for a connection to succeed. These connections can be one-way or two-way.
Infrared is the same technology used in most remote controls for home A/V gear such as TVs. Some smartphones are capable of controlling home A/V gear via infrared. Software that mimics a universal remote control is required, which may be included, or may need to be purchased from a third party and downloaded to the phone.
In early smartphones, from 2001 to 2007, infrared was also used for two-way exchange of data between phones, or between phones and computers. The main standard for this was IrDA.
This functionality was then replaced by Bluetooth, which uses radio waves instead of light. Bluetooth is faster, more reliable, and more versatile than IrDA.