The way that scientists and astronomers are able to see amazingly distant objects in space and describe them to us is almost unbelievable. Every object in space, be it a planet, a star, a comet, or an asteroid, either reflects or gives off light. That light can be measured and observed most accurately by telescopes and probes sent out into space.
The Hubble Telescope has been able to send back such incredible images, and to find over 400 new planets outside of our solar system because it is above the Earth's atmosphere and pollution, so it gets a clear look into space. That, and the fact that it is a very powerful telescope.
Different elements reflect light differently, so we are able to identify the age of a star based on how much reflected hydrogen and carbon is in the light beams generated from it. Our star, the Sun, for example, is a middle aged star, with about 2.5 billion years of hydrogen fuel left. We can tell that based on the light it gives us to read. We can tell the age of a nebula (remains of an exploded star) based on the distance that its farthest edges are apart and how fast the material is moving.
Recently, scientists have discovered other planets outside our solar system that have observable atmospheres, temperatures which could support life, and water.
One of the things that is great about the devices we've invented in the past few hundred years is that we have been able to shoot them out into space (unmanned) and have them send back images to us. You may have heard of the Hubble Telescope, as it was one of the most famous, but there are many like it. There are probes that are still travelling outwards away from the earth and beaming back their images and other findings.
So scientists are able to construct images of our galaxy and in fact many other galaxies using the images sent back to earth from these unmanned space vehicles.