I am quoting a text from a web sight before my question.

"Let's assume we have a 5 kg box on the floor. Let's arbitrarily call its current potential energy zero, just to give us a reference point. If we do work to lift the box one meter off the floor, we need to overcome the force of gravity on the box (its weight) over a distance of one meter. Therefore, the work we do on the box can be obtained from:

Work=Fd =mgh=(5)(9.8)(1) =49J "

My Question here is, if you apply F=mg on the box the box will stay at rest then how it can be lifted 1 meter?

In the answer if you say that you have to apply a little more force (F1) to produce acceleration in the body then my counter question will be, This means we are not applying constant force on the body first we apply a little more force on the body to produce acceleration and then we reduce the force to mg, if this is the case then to calculate the work we first need to calculate the work done by F1 (the little more force to produce acceleration) lets call it W1 then we need to calculate the work done by the force mg lets call it W2 and the total work will be W=W1+W2. Am I right?