For example, the key of C is the key with C as the main tone, and its scale is C-D-E-F-G-A-B. And the D key is a key with D as the main tone, and its scale is D-E-F-G-A-B-C.
each note can be raised or lowered by half or a whole note. For example, the semitone above C is D, the semitone below C is B, and the whole tone of C is D above and B below. These changes can be represented by ascending and descending signs, such as #C for ascending c and bD for descending d.
Generally, different keys are distinguished by the key signature indicated after the clef at the beginning of the score, and the key signature indicates the number of sharp signs (#) or flat signs (b), each of which represents a semitone. For example, a sharp sign is F#, which means that F is raised by a semitone in this key, and F# is the pitch of G.
I hope this explanation will help you understand the names and tones in music.