How do you calculate the size of the observable universe?
Short answer: Cepheids.
I know that doesn't give much information, but I'll try to explain in it full here! So what are Cepheids? They are a special kind of variable star, they are very stable and also have predictable brightness variations.
This means that astronomers can determine a stars distance by looking at the variability in their light. For this reason these stars are commonly called 'standard candles'.
Now that's how we measure the distance. We identify and see a cepheid far off in the distance and judging by its brightness to other cepheids nearby we can determine how far away it is.
The way I just explained that may sound a little confusing. Think of it like this, you have a basketball and you know it's size. Now you know it's a meter away, how big does it look? Lets say this basketball is 30 inches in circumference, and then a meter away it is 29 inches (I don't know exactly but this is just an example). Now you can use this as a figure of measurement.
So if a star is 10ly away, you can know by its size relative to one that is 1ly away. Which can be also sized by how big our star is with how close it is.