In thermodynamics, work is a way of energy transfer from a system to surroundings, under the influence of external factors such gravity, electromagnetic forces, pressure/volume etc.
Energy (ΔU) can cross the boundary of a system in two forms -> Work (W) and Heat (q). Both work and heat refer to processes by which energy is transferred to or from a substance.
ΔU=W+q
Work done by a system is defined as the quantity of energy exchanged between a system and its surroundings. It is governed by external factors such as an external force, pressure or volume or change in temperature etc.
Work (W) in mechanics is displacement (d) against a resisting force (F).
Work has units of energy (Joule, J)