a) Change the length of the pipe by adding a crook or (on a modern valved Trumpet) pressing a key. b) Change the resonant mode of the pipe you're using by pinching your lips tighter or looser. Approach B is the only one that works on a bugle, which has no valves or places to add different crooks.