This encoder can be used to count rotations of a motor, or can be used as an input device. As an input device, it can act a like a dial that can be turned infinitely in either direction to select from a menu, then pushed down to select an item.
It has a "D" shaped shaft which makes it very easy to 3D print a cap of your own design. (Just press-fit onto the shaft.) You could also 3D print a gear to interface it to a motor shaft to count rotations.
There are numerous libraries available to read this device, just search for "Arduino Encoder Library" and you'll find instructions. Depending on how you want to use it, one or another library might meet your needs better.