The melody of musical instruments is usually much more complicated than vocal music, so they all use fixed tones, especially in bands. It is easier to use staff than simple music.
The staff is to put the notes in different positions on the line or between the staff to represent a fixed pitch, that is to say, when the notes on the staff are fixed, the sound is fixed, which corresponds to the fixed fingering of the trumpet. Because this sound has nothing to do with tonality, it can be played regardless of the tonality of music. Trumpets are generally in B-flat, that is to say, no matter what music is played, it is in B-flat. As long as the ascending and descending signs indicated on the music table are followed, the ascending and descending notes should be the same.
When playing in a band, sometimes the parts and notes you play don't belong to any tonality, and there is no melody. You just need to play according to the position of the staff where the notes are, and according to the fixed notes and duration.
The pitch of the staff is expressed according to the natural height of the five elements where the notes are located. The five elements are like a ladder, and the pitch of the lower part of the line at the note is higher than that at the higher part. Therefore, staff is more intuitive and convenient to play than simple staff.
I suggest you have a brief look at the book "Staff Common Sense" while learning the trumpet. With the progress of trumpet learning, staff will naturally learn.