When we lift an object work done by gravitational force is negative $-mgh$ means gravitational force is taking energy from the body. How? Which energy is being reduced by the gravitational force?
This answer will be a little long but I think you’ll understand by the end of it.
Throw a ball up in the air. You have imparted initial Kinetic Energy (KE) right at the beginning. Observe the ball move up.
As the ball moves up, you see the velocity of the ball is reducing since the force of gravity is acting against it. In Physics, we say that this force of gravity is doing negative work on the ball.
The ball has now reached the top, its velocity is zero. Basically force of gravity has done enough negative work to reduce the velocity to zero and therefore its KE has also becomes zero. Let’s say this total work done by gravity in upward journey is W1 (it would be a negative sign e.g. -4J or -10J)
But what has happened to the initial KE. The KE of the ball keeps reducing as it moves up but another form of energy keeps increasing. This other form of energy is Potential Energy (PE). Thus the PE at start is zero and keeps increasing till all KE has converted to PE by the time it reaches the top of the flight. The gravitational force that did negative work on the ball and decreased its KE has in the process increased the PE of the ball. Thus negative work (W1) has resulted in positive change in PE. According to work KE theorem,
Delta KE = W1 ———- Eq. 1
but since Mechanical energy has to be conserved
Delta PE + Delta KE = 0 ———- Eq. 2
Use Eq. 1 to substitute Delta KE as W1 in equation 2, we get
Delta PE + W1 = 0
Delta PE = - W1
As an example, if work done is say -10 J and the change in PE is from say PE (initial) = 0 J to PE (final) = 10 J, then-
Delta PE = -W
or PE (final) - PE (initial) = -W
or 10 J - 0 J = - (-10 J)
10 J = 10J