A hydraulic cylinder is a mechanical device that converts hydraulic energy into linear motion. It consists of a cylindrical barrel, a piston, and a rod. When pressurized hydraulic fluid is introduced into the cylinder, it pushes the piston, causing the rod to extend or retract, thereby producing force and motion.