One way to vary your sound on the harmonica is to alter a scale with sharps and flats. To create a major scale in a key other than C, you need to figure out what notes to include. You do this by following these steps:
Take the new tonic note as the starting point from the scale.
Start the TTS TTTS pattern on the new tonic note.
Figure out which notes are pitched too low or too high to fit the major scale pattern.
Use sharps to raise notes that are a semitone too low and use flats to lower notes that are a semitone too high.
Use only sharps or only flats.
Use all seven note names.
For instance, to create a G major scale, you need to alter one note in the scale. Check out the major scale pattern moved to G. Instead of F, you need F♯. G major uses one sharp to create a major key pattern, so it’s known as a sharp key. Other sharp keys include D, A, E, B, and F♯.

Flat keys use flats to create a major scale. Here is the major scale pattern built on F. Here, B♭is needed to create the pattern. Other flat keys include B♭, E♭, A♭, and D♭.

You can use the F major scale to play in the key of its relative minor, D minor. You can use the G major scale to play in the key of its relative minor, E minor.