Please clarify this as I have been wondering about this literally for years.

I want to compose a song, I will start using use 4 chords and from that build all the instruments notes. The song is in C Major scale the chord progression is I-V-vi-IV (C,G,a,F)

One bar will be used for every chord.

So for bar 1, I can use any of the following C chords because they are within the C major scale the Cmaj CEG, CSus2 CDG, CFifth9 CDG, Cmaj7 CEGB,

Let's say I decided to use chord Cmaj CEG for Bar 1, does this mean that within bar 1, only these three notes can be played throughout all of the instruments, C E G?

Because if I chose Cmaj CEG and I use other notes that are not in the CMaj chord, I am no longer playing a C Major chord.

Or for bar 1 can I use any note that is within any C chord?

What do composers of great songs normally do?

Please do not respond, "In music you can do whatever you want" or "if it sounds nice go with it" music has no rules but it has common guidelines, In cooking class I can also do whatever I want but I wouldn't put ice cream in my scrambled eggs

Thanks in advance for the help