You do not play the eight on the last stroke. You play it with where you leave the cue ball while you still have a ball of your own.
If you do not know the eight’s pocket, do not tidy the last colour into a dead stop. Leave yourself an angle. Under pressure you take the pocket you have drilled, not the one that looks clever.