As you know, the hotter the star, the shorter-wavelength region of the spectrum the maximum of its radiation falls. In our case, the spectrum of star B is dominated by long-wave (red) radiation, and if on the way from the Earth to these stars there is not a large amount of interstellar dust that absorbs the light of stars and changes its color, then star A is hotter than star B.
Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.