The first step in creating a Hubble diagram is to find the distances to several galaxies. Unfortunately, measuring distances in astronomy is difficult. Fortunately, all you need for a simple Hubble diagram are relative distances to galaxies, not their actual distances measured in light-years or kilometers. In other words, you don’t need to know exactly how far away a certain galaxy is. It’s enough to know that the galaxy is twice as far away from Earth as another galaxy.
To measure relative distance, you need some way to compare galaxies. Since most galaxies are generally similar, you can try assuming that they all have the same average properties – that each galaxy is just about as bright and just about as big as any other galaxy. You can check later whether or not this assumption is true.
The picture below gives an idea of what you can conclude when you assume that all galaxies are similar. The picture shows to identical cans at different distances. The nearer can looks bigger than the farther can; you can measure their heights on the monitor if you want. If the cans were giving off light, you could imagine that the nearer can would look much brighter than the farther can.
The same effect occurs with galaxies. When we assume that two galaxies are similar (in brightness and size), then any differences in brightness or size we see between them are due only to their distances from us. Look at the following images:
We can assume that the galaxy that appears larger is just like the galaxy that appears smaller, but much closer to us. You will test this assumption later.