Thermodynamic work from operational principles