You need to be able to do both, depending on context.
If you are practice practicing, there is one thing you can do to work on both the trouble section while at the same time playing through the section. Select a section of music starting a few bars before and a few bars after the trouble spot - or even a few beats before and after if it is a small or rather complex section. Play that section in a fluid loop, not stopping to correct, but making note of what needs to be fix while continuing to play. On the next iteration of the loop, make efforts to fix the trouble again without stooping. The important focus is that you do not stop the loop for whatever reason, continue to play if you make a mistake, continue to play while you think about the fix, continue to play even if it means omitting notes so you can get through the passage, no matter what happens you must continue to play and loop that portion of music.
The transition between the start and end loop points don't have to be theoretically perfect, you can have a weird harmonies or phrase breaks. The point is, do not stop when you do the repeat: loop seamlessly even if the harmony, phrase, or counterpoint seems broken at the chosen points.