Work done by conservative force on a body depends
For work to be done there needs to be a force applied and a displacement produced in any direction except in a perpendicular direction to the force.
Thus, the work done an a body due to net force =force×displacement.
Always, the total force applied on a body may not be responsible for its motion and a component of force can also cause displacement in the body.
∴ Work done=(component of force acting in the direction of displacement of body) × displacement =(Fcosθ)×s