Answer: crankshaft.
You can see a crankshaft in the image attached.
The crankshaft is the piece colored in red.
When the pistons (coloroued) in gray move up-and-down (called reciprocating motion) the crankshafr spins, so converting the linear motion into rotational motion.