Headgear

Headgear was a form of clothing worn on a person's head.

Hats and caps
A hat (or cap) was a device worn on an individual's head. Typically, a visor or brim extended from the front of the hat so as to protect a person's eyes and head from the elements. They could also be a part of casual wear or be worn with a religious background. Hats sometimes had a design on their front, such as words or an image.

Guinan wore a variety of unique hats. (Star Trek: The Next Generation)

Tom Paris wore a hat to cover the haircuts his father forced him to get every summer. 

Types of hats

 * United Earth Starfleet cap : This cap with a brim, in the style worn by baseball players, was worn by United Earth Starfleet crew in the 22nd century. Captain Jonathan Archer and Crewman Alex had such a cap with their ship's registry, NX-01, stitched on the front. Archer, as well as Travis Mayweather and Crewman Ethan Novakovich wore these caps while exploring the first M-Class planet the crew of Enterprise surveyed.  Archer and Trip Tucker wore these caps while crossing the desert terrain on the Torothan homeworld.  Archer also wore his cap during his venture into Vulcan's Forge to help protect his eyes from the Vulcan sun.
 * Federation Starfleet officer hat : Uniform accessory worn by Starfleet officers, like Christopher Pike, in the 2250s, Starfleet Academy recruits and instructors also wore caps in the alternate reality.
 * Baseball cap : This design of baseball cap was worn by the Niners baseball team consisting primarily of the Deep Space 9 senior staff. The cap featured a baseball with the horizontal design of DS9 overlayed on the right-hand side stitching. Their opponents, the Logicians - from the all-Vulcan crew of the USS T'Kumbra - wore a cap with an IDIC, the symbol of their people, on the front.

Bajoran hats
The Bajoran Vedek's and Kai's wore special types of hats, mostly the female ones such as Winn Adami. (Star Trek: Deep Space Nine)

Helmets
Helmets were a device made of a material much harder than that of a hat. They were generally worn strictly for protective reasons, although they could also be worn for decoration.

The helmets included with Earth-Starfleet EV suits, according to Malcolm Reed, after wearing his suit for three days, felt as if it would have fused to his skull, leading him to threaten to "find the designer of this suit make him wear it for three days."

Types of helmets

 * Army helmet : Several of the Onlies on Miri's planet wore helmets resembling those of United States Army soldiers.


 * Football helmet : On the planet Earth, players of the sport of football wore protective helmets equipped with facemasks. One of the Onlies on Miri's planet wore a football helmet similar to those worn on Earth in the mid-20th century.


 * Romulan helmets : Crew members aboard Romulan Birds-of-Prey during the 2260s wore helmets. Some exceptions include the ship's commanding officer and his centurion.


 * Starfleet security helmet : Introduced in the 2270s, these helmets were a part of a Starfleet Security officer's uniform, due to the sometimes hazardous nature of their work.


 * Klingon helmets : Light helmets were donned by workers in the underground dilithium mines of Rura Penthe in the 2290s. They were not in evidence during dilithium mining at Rura Penthe during the 2150s.  In the alternate reality, all members of the Klingon Defense Force wore helmets that gave everyone the appearance of cranial ridges.


 * Hunter helmet : The Hunters, a species from the Gamma Quadrant, wore these high-technology helmets during their hunt for a Tosk. The helmets allowed the Hunters to see even the cloaked Tosk.

Ekosian Nazi helmet

Within their military, Ekosians soldiers wore helmets identical to those of the National Socialist Party in 1930's-1940's Earth