I understand modes ..but I didn't understand how to use them. Over which chord can I play which modes. like there is a progression of C Am F G .... should I play C Ionian C Dorian C phrygian and so on or should I play C Ionian D Dorian E phrygian....
Understanding modes really means understanding how they sound, not just how they're constructed. The sound will tell you if the mode is consonant with the chords that you're playing in any given context.
A simplified rule that I used for modes when I started learning them is to identify which are major and which are minor and then learn the "decoration" notes.
For example:
Dorian is a minor mode. Compared with the natural minor Dorian has a 6 not a b6.
Phrygian is a minor mode. Compared with natural minor Phrygian has b2 not a 2
Lydian is a major mode. Compared with major Lydian has a #4 not a 4
Which you chose depends on the sound you want and the context of other chords.
And remember, the natural minor is a mode itself Aeolian spelled 1 2b3 4 5b6 b7 1
(And of course major itself is Ionian spelled 1 2 34 5 6 71)
The way I've found to get modes into my hears is to loop a minor chord and then play the minor modes against it and learn to hear the "feeling" that it gives. Same with major chords. Notice how much cooler it is to play Lydian vs Ionian over the same major chord. That was when I had my "A Ha!" moment with modes over an F major. It's that #4 that makes all the difference!
The example you give above: C Am F G -- these are ALL diatonic chords in the key of C. So whether you play C Ionian A Aeolian F Lydian or G Mixolydian, you're choosing ALL the same notes in the key of C -- just the white keys on the piano.
This is why thinking in modes doesn't help without knowing your triads and your chord tones for all the 7th chords for the major and all the varieties of minor scales. You have to know how they sound and which degrees give them their sound and how they sound with the "decoration" notes of any given mode.
Once you have the sound, then the name given to that sound will be useful. Until then everything is just a collection of notes cherry-picked from the 12 tones to create major and minor scales.
So, what should you play? Play C major focusing on the R 3 5 of whatever chord you're on and how to get to the R 3 5 of the next chord in a way that sounds cool.
Here is Tomo's comment:
"Thanks so much for subscribing to my Guitar Wisdom. I recommend that you learn to play triads and arpeggios over chords. I always try to focus on melody, and simple phrasing is really helpful. Maybe this video will help."