Rank insignia are generally used by races and cultures that wear uniforms. In humanoids, rank can be displayed by stripes (such as braid) on the sleeves or epaulet, or in the form of pins (like pips and lozenges), embroidered insignia and patches. These of course differ between civilizations.
Braid (or rank stripes) are bands of fabric or metallic material designed to denote rank on a uniform. Officers of Earth's United States Navy were known to wear rank stripes on sleeves and epaulets. That system was similar to insignia used in some eras of Starfleet history.
The Earth Starfleet of the 22nd century used rank stripes on dress uniforms for officers and on the standard jackets of flag officers. The mirror universe's Terran Starfleet used stripes on the standard uniform epaulets for officers, and both the epaulets and sleeves for flag officers.
In the 2250s, Starfleet used stripes of braid for both officers and noncommissioned officers, on the sleeves of standard uniforms and on the epaulets of dress uniforms. By the 2260s, only officers above ensign wore sleeve rank stripes, and only on standard uniforms. The 2260s dress uniforms denoted rank by braid around the collar, again only for officers. In the 2270s, all officers wore rank stripes, either on the sleeves or epaulet, depending on the uniform.
Chevrons and rockers are stripe insignia that were used in many of Earth's land, air, and naval forces to denote enlisted rank.
Epaulettes are devices worn on the shoulder, quite frequently to denote rank or grade, or perhaps honor.
The lozenge is what is commonly referred to as a diamond. It is found in a deck of playing cards, and in the rank of a first sergeant.
Stars, in the vernacular of rank insignia, are insignia, often used to denote flag officers. The United States armed forces used groups of these insignia for generals and admirals. A similar approach was used by Starfleet, as flag officer epaulet insignia in the 2270s.