The iPhone is a touch-screen smartphone made by Apple. Although Apple provides a manual that explains the lights and symbols on the phone's screen, under certain circumstances, you might also see a red light appear next to the earpiece speaker. This indicates that there is moisture inside your phone and that you will need to wait for it to dry before trying to use it again.
The red light near the earpiece speaker on an iPhone is caused when the iPhone's water detection sticker is activated. This is a small sticker on the inside of the phone that turns red when it is exposed to moisture or water. The sticker stays red until it dries out, at which point the light should disappear. While the sticker is red, you shouldn't try to use your iPhone as parts inside the phone could also be wet.
The red light caused by the sticker could be activated for a number of reasons. The iPhone is not waterproof so if it is submerged in liquid -- for example, dropped in a glass of water -- working parts inside the phone will get wet and could malfunction. Since it measures moisture, the red light could also be caused by using your iPhone in heavy rain or in areas of high humidity, when the moisture content of the air is high.
If your iPhone displays a red light near the earpiece speaker, you will need to wait for it to dry out before you can use it again. Turn off the iPhone and unplug any cables, then leave the phone to dry. Try placing it in a bag of raw rice or commercial desiccant, as this can draw the moisture out and help speed the drying process. It could take up to a month for your iPhone to dry out fully. Do not apply any heat to the phone from a radiator, hair dryer or similar as this could damage the circuitry within the iPhone.
To prevent the red light on top of an iPhone, you need to protect the phone from excess moisture or liquid spills. Try developing a habit of moving your phone away from glasses or mugs, and you might want to invest in a protective case that could help prevent excess water entering the phone. If your iPhone does get wet and the red light comes on, you can leave the phone to dry, but do not try and service it or open the back of the phone yourself. Instead, take your iPhone to an Apple retailer for professional advice.