Measure the cylinder you have removed from the one face (where the key goes in) to the fixing hole under the cam (the rotating arm of the cylinder) and then measure from the fixing hole to the other face of the cylinder. These 2 dimensions give you the size of your cylinder for example the cylinder in the diagram would be a A/B (A and B being the respective measurements in mm).
Slide the replacement cylinder in ensuring that if your cylinder is uneven the longer side is on the correct side. The fixing screw will not go back in if the cylinder is wrong.
Secure the screw and your lock is changed.