
can be somewhat misleading.

is the distance through which the force is
applied.
An example:
Suppose a block is standing still on a surface (not necessarily smooth). You draw a start line where the block is, and draw a finish line x metres away. Suppose you start pushing that block towards the finish line, applying constant force F throughout (your hand will also have to accelerate if you want to keep constant force on the block). Once the block reaches the finish line, you immediately remove your hand.
Then work you've done on the block is then

.
It doesn't matter whether you're in a vacuum or the air is as thick as in a sauna. The work YOU do is the same each time, since you apply a force

through a distance

. It is irrelevant how much further the object goes after you remove your hand.
The reason why the object will travel less distance if there's more air resistance is because the AIR is doing work
against the object as well.