Like the other head coverings parasol and umbrella, sombrero is named to describe its benefit when worn.
Thus this wide-brimmed hat from sunny Spain is so-called from the shade it affords its wearer, the Spanish for “shade” being sombra.
Umbrella is similarly named, from the Latin umbra, “shade,” with a diminutive ending, hence, “a little shade.”
Parasol is from the Italian parasole, from para, a form of the verb parare, “to ward off, parry,” combined with sole, “sun,” hence, “warding off the sun.”