My book says work can be converted into heat but I want to know how work affects kinetic energy of molecules which, when transferred, is called heat?
Work can be understood as a variation of energy during which the transporters (may they be molecules) are spatially aligned or bonded, meanwhile heat is a variation of energy in which the transporters aren't aligned (therefore heat dissipates energy). With this in mind, any machine that uses an ordered energy transfer (like your hand waving) can induce heat in a fluidic means, as particles in fluids are initially moving randomly and are not likely to move far on the orientation of your hand. In this example, the induced work is little and restricted to the analysis on the surface of the moving hand, but if the analysis is made from further on a wider system, we can assume you're doing work to generate heat alone.
Work is the change in kinetic energy, and in some cases, say you do some work to move a bunch of molecules; if it results in them colliding, thereby releasing heat in the process, due to their kinetic energy during collisions converting into heat.