I studied music theory for a good long time before it dawned on me that you can read the major scale right off the circle of fifths. Here’s the C major scale on the circle. The white notes are the ones in the scale and the black ones are the ones outside the scale. The white notes correspond to the white keys on the piano, and the black notes to the black keys.
The circle of fifths trick works for all the major scales, not just C. Pick any note on the circle and think of it as the root. The note immediately counterclockwise from the root will be the fourth of the key. The five notes going clockwise from the root are the fifth, second, sixth, third and seventh of the key respectively. The other five notes will be the ones you omit — the “black keys.”