Suppose we have an object which the mass is $m$ kg. If we lift up the object and the object moves with constant upwards velocity, the force we're applying on it will be equal to $mg$, and say if the object moved a distance of $h$ meters, technically we should have done $mgh$ joules of work. However, gravity is also doing work on the object, and since its direction opposes to the direction of the object's movement, it should have done $-mgh$ joules of the work, and by calculation the total work done on the object should have been $mgh + (-mgh) = 0$ joules.
Nevertheless, if we consider the potential energy of the object, since the object has gone up by $h$ meters, the potential energy should increase by $mgh$ joules as the kinetic energy is kept constant, meaning that there has to be some total work done on the object. So why did we run into a contradiction?