How to attach a jumper wire to rotary encoder pins?
Those wires have been soldered to the pins of the encoder. Then each solder joint has been protected by a short length of heat-shrink tubing.

So you want to search for a soldering iron, solder, and heat-shrink tubing. The heat-shrink can be activated by placing it against the tip of the soldering iron, but much better results are produced by getting a heat gun, which produces a stream of hot air.