Dear Student,
In thermodynamics, we mainly need to assign signs to the energy and work depending on the following cases:
1. If energy enters the system, its sign is positive.
2. If energy leaves the system, its sign is negative.
3. If work is done on the system, its sign is positive.
4. If work is done by the system, its sign is negative.
Regards.