Stars are classified into the following categories from hotest to coolest
(hotest) O B A F G K M (coolest)
The reason for the odd arrangement of letters is historical. When people first started taking spectra of stars, then noticed that stars had very different hydrogen line strengths, and so they classified stars on based on the strength of the hydrogen line from A (strongest) to Q (weakest). Latter it was found that some of the classes were actually duplicates and those classes were removed. It was only much later that it was discovered that the strength of the hydrogen line was connected with the surface temperature of the star.
More recently, the classification was extended into O B A F G K M L T, where L and T are extremely cool stars or brown dwarves.
Class O stars are very hot and very luminous, being strongly blue in colour. Naos (in Puppis) shines with a power close to a million times solar. These stars have prominent ionized and neutral helium lines and only weak hydrogen lines.
Class A stars are amongst the more common naked eye stars. Deneb in Cygnus is another star of formidable power, while Sirius is also an A class star, but not nearly as powerful. As with all class A stars, they are white. Many white dwarves are also A. They have strong hydrogen lines and also ionized metals.
F stars are still quite powerful but they tend to be main sequence stars, such as Fomalhaut in Pisces Australis. Their spectra is characterized by the weaker hydrogen lines and ionized metals, their colour is white with a slight tinge of yellow.
Class G stars are probably the most well known for the only reason that our sun is of this class. They have even weaker hydrogen lines than F but along with the ionized metals, they have neutral metals.
Class K is slightly cooler than our sun, they're orange stars. Some K stars are giants and supergiants, such as Antares while others like Alpha Centauri B are main sequence stars. They have extremely weak hydrogen lines, if at all, and mostly neutral metals.
Class M is by far the most common class if we go by the number of stars. All our red dwarves go in here and they are plentiful, more than 90% of stars are red dwarves, such as Proxima Centauri. M is also host to most giants and some supergiants such as Arcturus and Betelgeuse, as well as Mira variables. The spectrum of an M star shows lines belonging to molecules, neutral metals but hydrogen is usually absent. Titanium oxide can be strong in M stars.
The new class L are stars that are a very dark red in colour, they are brightest in infra red. Their gas is cool enough to allow metal hydrides and alkali metals to be prominent in the spectrum.
Right at the bottom of the scale is T. These are stars barely big enough to be stars and others that are substellar, being of the brown dwarf variety. They are black, emitting little or no visible light but being strongest in infrared. Their surface temperature is a stark contrast to the fifty thousand degrees or more for O stars, being a cool 700 degrees celcius. Complex molecules can form, evidenced by the strong methane lines in their spectra.