You will always make mistakes, so the key is practicing in a way that eliminates mistakes.
"Practice makes perfect" is a Big Lie.
If you don't practice in a smart method you will never get that good -- so what is important is not just practice itself, but good practice technique.
When practicing a piece of music or song, there are really two modes I would practice in:
- Section mode. In this mode I practice in focused areas. I always try to hear internally and "mentally practice" each of these sections before I practice them. Also, key to section mode is to start slow, really slow, and only start to gradually speed it up once I get it (Don't be too conservative though or else you will never learn to play at speed).
- Run through mode. In this mode I run a piece through or larger sections. This is essentially practicing performance. I found it ideal to spend less time doing this than section practicing, but you still to need to make sure you are doing it.
With both of these the idea is practice makes permanent, not perfect. If you just keep hammering mindlessly away at a passage and playing it wrong, you get get better at playing it wrong. That is why you want to think before you play, and start slow. When you do this, you basically never or rarely actually play it wrong.
Remember this stuff takes time, playing the same section over and over and over again for an hour in one day is a waste of time. Play a section slowly maybe 2-5 times, then speed it up. When you hit your speed limit for the day, just move on to the next section. The reason is that these skills actually develop while you sleep, so you can't really force it.