Here's a short primer.
You need a cylinder and ejector ASSEMBLY.
Cylinders head space on the ejector so fit you fit an ejector to the cylinder then fit the assembly to the frame.
Once the ejector is fitted to the cylinder (the ejector lines up with the chambers with no overlap and seats fully into the cylinder) the rear of the ejector is precision surface ground to set head space.
If the ejector is a used one, it may be too short to be fitted to the gun. Even if the ejector is original to the gun, the cylinder isn't and things change.
A short ejector is unusable because it can't be stretched or made longer.
With the head space set the cylinder is installed on the yoke or crane and it's test fitted into the frame.
The cylinder is checked for proper end shake, which is to be minimal. (End shake is back and forth movement of the cylinder in the frame).
In reality, what you're doing is fitting the cylinder assembly AND the yoke at the same time, since the cylinder has to be on the yoke to set head space.
This is a matter of test fitting the assembled cylinder, ejector, and yoke into the frame, deciding what needs to be altered just enough to get it in, then setting head space and adjusting end shake.
This is sort of a one man band trick.
If the cylinder won't snap into the frame, the yoke barrel is trimmed until it will.
If the closed assembly has too much end shake, the yoke is either stretched (factory method) or hardened stainless steel washers are installed into the cylinder to set proper end shake.
Next is to check chamber/bore alignment on all chambers with a range rod.
Then timing is checked on all chambers.
For fuller details, buy the book "The S&W Double Actions Revolvers: A Shop manual" by Jerry Kuhnhausen. This was a training aid for new gunsmiths and shows in detail how cylinders are fitted and adjusted.
Note as above, that used parts may or may not be usable at all and S&W parts did change over the years.