A couple things that help me:
Give all sections of the song equal time. For instance, if you try the song from the beginning, get stuck, go back to the beginning, get stuck, go back to the beginning, then firstly, you’re ignoring the rest of the song, and secondly, you’re “practicing your mistakes”. Work on the beginning for a while, then work on the middle for a while, then work on the end for a while, then next time work on the end first, then the middle, etc.
If while practicing, your goal is to play the whole tune, keep playing through to the end of the tune even if you stumble. Don’t keep stopping and going back.
Every once in a while, cover up the music and let 'er rip. You probably know the piece better than you think you do.