Imperial Navy Troopers

Imperial Navy Troopers are the soldiers of the Galactic Empire's Imperial Navy. They appear in Star Wars throughout both Legends and Canon.

Canon
Navy Troopers are distinguished by their black tunics and large, gleaming black helmets. They serve aboard Star Destroyers and any installation connected to the Imperial Navy. They're trained in boarding enemy vessels as well as repelling enemy boarders, and are armed with E-11 blaster rifles or DH-17 blaster pistols. In their duties they serve a variety of functions, primarily as guards and soldiers, but also as technicians, gunners and ground crew. On board the Super Star Destroyer Executor, a pair of Navy Troopers accompany Darth Vader wherever he goes and stand guard outside his personal quarters. They often have the duty of dragging away the corpses of those the Dark Lord kills, such as the unfortunate Captain Needa.

Death Star Troopers
An elite subset of Navy Troopers are the Death Star Troopers. These Navy Troopers were handpicked by Grand Moff Tarkin to serve aboard the first Death Star. Their uniforms and equipment didn't differ from those of standard Navy Troopers. Death Star Troopers such as Chief Gunner Endo Frant and Corporal Ansin Thobel served as gunners, operating the battle station's devastating superlaser. Others, as on the Executor, acted as bodyguards to Lord Vader, accompanying him throughout the battle station and serving as security for the Death Star's detention center.

Those acting in the latter capacity came into conflict with the disguised Luke Skywalker and Han Solo. Wearing the armor of Stormtroopers, the pair came in with a Wookiee "prisoner," Chewbacca, in the hopes of freeing the captive Princess Leia Organa. The officer in command however grew suspicious, ordering two of the troopers forward, resulting in a firefight that saw all the Imperial personnel present in the detention center slain. All of the other Death Star Troopers died later during the Battle of Yavin when Luke blew up the Death Star.

Following the completion of the second Death Star, a new army of Death Star Troopers was commissioned to serve under Moff Jerjerrod. These troopers serve both aboard the battle station itself as well as in the shield generator bunker on the nearby forest moon of Endor. When Lando Calrissian and Wedge Antilles destroyed the Death Star it is unknown if all the Death Star Troopers aboard were killed or if some managed to evacuate. Those on Endor were either killed in battle of captured by the Rebels.

Trivia

 * This type of Imperial trooper was originally envisioned as "Vader's Guard Corps", explaining why their helmets are exaggerated versions of his. They only serve in this capacity in A New Hope and The Empire Strikes Back.