A number of different types of underwear or undergarments serves a unique range of purposes. People wear underwear for modesty, to protect outerwear from bodily fluids, to conform to social norms and to keep warm, according to Wikipedia.
Underwear can refer to any garments worn under an exterior layer of clothes but is most frequently used in American English as shorthand for garments that cover the genitalia, such as boxer shorts and panties. These garments are primarily worn for comfort and to protect the outer clothing from urine and feces. In the case of men, they may be worn to stabilize the testicles and keep them in place. Brassieres serve a similar function for women. Underwear may also be worn to stimulate sexual interest. Edible underwear is an example intended solely for the purpose of erotic play, notes Wikipedia.
Long underwear or long johns are used to preserve bodily warmth in cold conditions. A thin T-shirt may be worn under outer clothes for the purpose of protecting exterior shirts from perspiration stains. Certain types of undergarments are used to discreetly alter body shape, such as girdles and corsets. Certain religions, such as Judaism and Sikhism, prescribe the wearing of certain undergarments at certain times.