In this case, three forces are acting on the object
1. tension (T)
2. weight (mg) and
3. applied force (F)
Using work-energy theorem
`W_("net")=Delta KE`
or `" " W_(T)+W_(mg)+W_(F)=0`..........(i)
as `" " DeltaKE=0`
because`" " K_(i)=K_(f)=0`
Further, `W_(T)=0`, as tension is always perpendicular to displacement.
`W_(mg)=-mgh "or" W_(mg)=-mgl(1-cos theta)`
Substituting these values in Eq.(i), we get
`W_(F)=mgl(1-cos theta)`