Installing a limit switch to a small winch
The easiest way would be to use normally-closed limit switches in series with the black and blue wires leading to the direction control switch. This way, the limit switch only stops one direction without interrupting the other direction.

For example, assuming the black wire runs the motor forward, connect the forward limit switch in series with it.