Redshift is the shift of spectral lines toward longer wavelength. Blueshift is the shift of spectral lines toward shorter wavelength. We can learn whether a celestial body is moving radially toward or away from us and its radial speed, by knowing whether its spectral lines show a blueshift or a redshift, respectively. According to the Doppler effect, a redshift implies that the object is moving away from us, and a blueshift implies that the object is moving toward us. Spectral lines tell astronomers what atoms and molecules are present and how much of each there is.
Astronomers can determine the lambda max of the spectra.
Therefore, using the relations between lambda max and the temperature for a blackbody, the temperature of the celestial body can be obtained if it behaves at least approximately like a blackbody. Doppler shifts, which are shifts in the wavelength of spectral lines of atoms and molecules, tell astronomers about the motion of and within the celestial object. We can find out whether a galaxy is moving radially toward or away from us, and we can also determine the rotation of the galaxy by observing differences in its Doppler shift from one end of the galaxy to the other. We can do similar things with stars. There are similar tricks we did not discuss that enable astronomers to determine other properties of celestial objects, such as magnetic field strengths and gas pressures.