When I was relatively young, my music teachers instructed me to practice difficult material slowly, and gradually increase the speed. This is the standard method of learning, and it works very well. Research has proven that the human neural network adapts itself to repetitive tasks by increasing the connectivity between appropriate neurons. This is why we slowly progress from struggling to a state of "muscle memory."
Unfortunately, Practice Monster is an impatient beast. He doesn't want us to do enough repetitions, and he pushes us to prematurely increase the speed. By not spending enough time at the slow tempos, we introduce mistakes into the process, and worse still, we end up practicing these sloppy mistakes! Here is a solution that I have used in my own practice.
Begin by selecting a manageable amount of difficult material, and set a tempo that is slow enough that you can reliably perform the excerpt without making any mistakes. Once you have determined this tempo, begin by playing a few metronome clicks slower than the tempo you just set. Play the excerpt ten times in a row, and do not allow a single mistake. When you have played the selection ten times perfectly, move to an even slower tempo. Continue this process until you are performing at a ridiculously slow speed.
At the slowest tempo imaginable, make sure that you are performing with a beautiful sound, perfect rhythm, and flawless technique. In super slow-motion, focus all of your attention on the note ahead of the note you are on. When you move, immediately start thinking about the next note. Try thinking about the notes in groups of two, and think a full couplet ahead of where you are. Whatever you do, resist the urge to speed up. If you start making mistakes, go even slower. Even if you play perfectly, continue to decrease in speed.
End a long session, as long as you can stand, by immediately moving back to the tempo that you started at. If you have success, experiment to see how quickly you can play the material. My experience has been that "the big slowdown" is more effective for building speed and muscle memory than the traditional method of incremental acceleration. My hypothesis is that the brain has an easier time hard-wiring itself when we do the repetitions at very slow speeds.