system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do astronomers identify galaxies that are light years away from us?
gpt
It depends what you mean by identify. 

If you mean "How do we tell that they are galaxies", we tell using telescopes that are big enough to make out tiny details. The size of the telescope and the color of the light you're looking at determine whether or not the galaxy looks like a dot or a blob or a galaxy; this is one of the reasons why we like to build bigger and bigger telescopes, to be able to make out smaller details. The other reason is that big telescopes can collect more light, so you can see dimmer things. Galaxies are really faint, because they're so far away! 

We can also tell that they're galaxies by looking at a spectrum of the light they emit. Galaxies don't look like anything else: they're stars and dust and black hole emission all added together. So even if it just looks like a dot, you can still tell if its a star or a galaxy because galaxies emit a different combination of colors than stars do.

If you mean "How do we tell how far away they are", there are a few ways to do this. One is by using "standard candles". Basically there are some objects (certain types of supernovae and variable stars) in other galaxies that we know exactly how bright they are, and since brightness drops off with distance in a known way, we can measure the distance just by measuring how bright it looks to us. Another way is using redshift. The universe is expanding uniformly, so the farther away something is, the faster its moving away from us. This makes light "stretch out" as space stretches out, and when light stretches out it gets redder. So you can look at the light of the galaxy and compare it to other galaxies you know about, or chemical signatures from a lab, and determine how far away it is that way. This has some errors because galaxies also move pretty fast, so their actual motion can throw a wrench in that calculation, especially if the galaxy is close by so the redshift from the expansion of space isn't a huge effect. 

Lastly, if you mean "tell if its the same galaxy we saw before" i.e. how do we name galaxies; usually just by where they are on the sky. The sky has a coordinate system, and there are WAY too many galaxies to give them all a unique name (though some are named from previous conventions from early surveys). So we say "in this coordinate system, this galaxy is at this coordinates". Andromeda's name, in this context, is J00424433+4116074. Which is to say, we name galaxies by pointing to where they're at on the sky and saying "that one right there"