Let a constant force F be applied on the body such that it makes an angle θ with the horizontal and body is displaced through a distance s.
Then work done by the force in displacing the body through a distance s is given by
W = (F cos θ) s = Fs cos θ
⇒ W = (F cos θ) s = Fs cos θ