The surface temperature of a star can be estimated from the color (or frequency) of the light it emits. To understand this fact let us analyze the following example. Take a needle and heat it in a candle flame, after a few seconds you will see the needle is glowing red. Now heat it for a minute or so you will observe that the color of the glow is now near to yellow. Now, yellow light is more energetic than red light. The sequence of decreasing energy of different color is: Violet > Indigo > Blue > Green > yellow > Orange > Red. Hence, more is the surface temperature; more is the shift of the emitted light towards the blue color.
Thus, we can conclude that the hottest stars are blue in color and the coldest stars are red in color.
The hottest stars in the Universe are the Blue Giants and the coolest stars in the Universe are the Red Dwarf.
Hope this explanation answers your query.
Do write back if you have any doubt or confusion.
Keep posting & have a nice day!