There's an LED light near the earpiece that only works when your phone is charging from a very low battery level. Unfortunately, you can't customize it without rooting the phone first. But rooting the phone will mean voiding your warranty.
They are proximity sensors which help detect distance so that the camera may focus faster. Check cpu z app, you'll find 2 options named rear proximity sensors.. the max distance they can measure is 10cm and least is 1 cm as you can figure out it is useful for macro shots.