Here is the formula for work
W = -(integral)PdV
This refers to the external work done on the system, not the work done by the system(this is what used to confuse me).
If the work is positive, this means that the external environment is doing work on the system. When the work is negative, this means that the external environment is doing negative work, thus the system is actually doing the work.
Say a system undergoes a quasistatic constant pressure process where Va changes to Vb(we assume this is not free expansion, why?). If Vb>Va, the system has expanded. In this case, the environment did not do the work, the system did it in order to expand itself, right? So, the work must be negative by sign convention(as i said, the Work refers to the amount of work done by the external environment on the system). If Vb<Va, the system has shrunk. It is clear that in this case the environment is doing work on the system to cause its volume to shrink, so the equation for work gives a positive value(since (integral)dV is -'ve).
To put it simply:
Work < 0 => work done by system
Work > 0 => work done on system