The hydraulic cylinder consists of a cylinder barrel and a piston rod
First things first, SAFETY. Take time to inspect the machine and study the area in which you need to work. Understand the hydraulic cylinder system you are working on to a level where you know without question if there is any stored energy present (accumulators, heavy load on cylinders, machine parked on a hill etc), any danger that could hurt yourself or any other person.
Ensure the machine you are working on is tagged out and isolated so others cannot come and start the machine while you are working on it.
Once you have the machine locked out and you are certain there is no stored energy left in the lines you will need to then remove both ends that fix the cylinder to the piece of hydraulic equipment. Handy Hint; Be sure to remove the hoses/pipe work and plug both the cylinder ports and the hoses/pipework first..
Be sure that there is no pressure in the cylinder. If the cylinder clevis pins are tight to move it could be due to the fact that the load is still acting on the cylinder. It can also mean your clevis pins are seized and could require engineering assistance to remove.
Removing a cylinder from a hydraulic system can be a messy job, ensure you contain any hydraulic oil spill that could occur. Plug and cap both the hydraulic hoses and/or pipework along with the ports on the cylinder to ensure no oil is spilt in transit.
Once both the piston rod end and base end hydraulic pins have been removed the cylinder can now be removed.