Answer:
The short answer: practice. The long answer: You might need a private instructor to make sure your technique is good. While taking private lessons, you need to practice the fundamentals: scales, lip slurs, etc. Then when you are practicing your music, you need to practice it perfectly. Meaning, get a measure perfect before running through the piece. If you are making a mistake - stop and fix that mistake until you can play it perfectly 4 or 5 times in a row. Remember the words of Vince Lombardi: Practice doesn't make perfect - perfect practice makes perfect. If you practice it wrong, you will always get it wrong.