Why is there a cos theta in the formula of work done?
The force applied to the object produces two effects - changing the kinetic energy of the object by changing its speed and changing the direction of its path.
The work is supposed to tell us, how much kinetic energy was transferred to the object (or from it). The kinetic energy is however increased only by the component of the force in the direction of the motion, which is why the cosine appears. The perpendicular component serves only to curve the trajectory and there is no energy associated with the curvature of the motion so we are not interested in this component.
For example, in a circular motion, the parallel force increases kinetic energy while the normal component only maintains the rotation. That is to say, components parallel to motion increase velocity, while normal components only change trajectory but not the modulus of the velocity.
Thus, we multiply it with cosθ in the formula of work done.