The closer people are (or feel they are) to a goal, the more likely they are to continue.
Show progress. Reduce unnecessary steps and guide the user to finish the task.
If you have any research evidence, that this tip does not work in specific conditions, please share it with us. We will expand the database with that particular case to grow the collective knowledge together.