What you should do when you have a certain part that you mess up consistently, is SLOW it down, and STRIP it down until you only play the part slightly BEFORE the mistake, and/or slightly AFTER the mistake.
So what that would look like is:
say there's a riff in the song and you can play it well up to a certain point - this is the part that you mess up. Start at the beginning of the riff, and slow it down 10-20bpm or as much as you can so you can play it without making the mistake - then play ONLY that part of the song until the bar or riff is over. Once you start nailing it when it's slowed down, speed it up 10bpm. Practice this until you have it down and you don't make mistakes another 10bpm higher.
To integrate it into the full song, play a small section where the mistake you've been working on was, if it's in the verse, you will play ONLY the verse until you can get it down. Keep in mind that you may have to slow it down still.
That's exactly what I do when I'm learning a song. You may want to use a metronome so you can practice the problem areas more efficiently, but other than that, this should help you to never make those mistakes again.
Keep consistent with it and you'll have these parts down in no time. :)