There are many important aspects to being a good musician. One of the most sought-after and impressive skills is technical mastery of one's instrument, including the ability to accurately play fast passages with lots of notes in them. This ability cannot come without practice, but only quality practice will produce the desired results. Here are some tips for developing trumpet technique.
Use proper valve technique. Many trumpet players, especially as beginners, will make the mistake of playing with their fingers stretched out and flat over the valves, rather than curling their fingers and making contact between the valve caps and the tips of the fingers. The latter style of playing is more proper technique and will give the player better speed and agility.
Learn and practice scales. A high percentage of technical passages in jazz and classical music are heavily based upon scales and modes, so learning to play all major, minor and modal scales in all twelve keys, quickly and from memory, will give a player a strong technical foundation to easily master fast music.
Study technique method books. These books feature etudes that are based around common permutations of scales, chords, and other types of musical gestures commonly found in Western music. Two of the most standard technique books for trumpet players are the "Arban's Complete Conservatory Method" and "Top Tones for Trumpeters."
Practice lip slurs. While a good deal of learning to play fast is based on finger training, it's equally important to train your embouchure (lip setup) to move quickly and accurately through the partials. Technique method books contain lip slur studies, but you can also create your own by moving through all valve positions and practicing moving through the partials. Practice partial motions that move upward and downward, motions that skip partials, and partial motion that moves across your entire pitch range.
Woodshed your music. This is a common musician's term that refers to the process of slowing down a technical passage and practicing it piece by piece, over and over, gradually speeding it up until it's up to the correct tempo. (The term "woodshed" is reference to hard work, as in chopping firewood.) To have the greatest possible mastery of a fast passage, learn to master it.
Learn to "think slowly" when playing technical passages. This mental technique will help you play faster on the spot without practicing the passages: as the technical passage approaches, try to remain as calm as possible and focus on each individual note as it passes by. This takes practice, but once you've mastered it, it will feel somewhat as if time is slowing while you focus on playing.