Only the part that agrees gets paid
Push a sled with a rope angled up at the shoulder and part of your pull lifts rather than drags. Only the part along the motion does any work, and the bookkeeping is a dot product wearing units: , read aloud W equals F-x d-x plus F-y d-y. and are the force's components in newtons, and the displacement's components in metres, and comes out in joules — a newton-metre, and a scalar, because a dot product never returns an arrow.
The sign carries the story, so read it before you compute. Force leaning along the motion: positive, energy paid in. Force fighting the motion — friction, a brake, gravity on the way up: negative, energy taken out. Force square across the motion: exactly zero, and that is not a technicality. Carry a heavy bag down a level hallway and you do no work on it whatsoever, however loudly your arm objects. Behind the algebra sits one picture, the scalar projection — the shadow the force casts along the direction of travel, in newtons. Multiply that shadow by the distance and you are back to . Work is the shadow, paid by the metre.