The modes are 7 different tonalities to which we give the root to the same note.
An easy way to get the root of these seven different tonalities is to reverse the order of the diatonic, or harmonic minor, or melodic minor, or major harmonic scale formula.
As you're talking about the diatonic scale, it's formula is ---> 1w2w3h4w5 w6w7h8--->. But if we reverse it we get: <---8h7w6w5w4h3w2w1<----
Number 1 is the root. If you're looking for all the modes and the root is G (just to say any note) move 1 descending tone and you'll get F and this is the root of 1 of these 7 different tonalities and gives you the dorian mode. Move 1 more descending tone and you'll get Eb, and that's the root of the tonality that gives you the phrygian mode. Now move 1 descending semitone and you'll get D which is the root of another of the 7 different tonalities and gives you the lydian mode. Move 1 more descending tone and you'll get C wich gives you the mixolydian mode, move 1 more descending tone and you'll get Bb which gives you the aeolian mode. Move 1 more tone and you'll get Ab which gives you the locrian mode. And if you move 1 more descending semitone you'll get G again, and again you are in the Ionian mode.
Remember, Ionian is the 1st mode, so G is the 1st note of the mode since the tonality is G. Dorian is the second mode and G is the second note of the new tonality, F. Phrygian is the 3rd mode and G is the 3rd note of the new tonality, Eb. Lydian is the 4rth mode and G is the 4rth note on the new tonality, D. Mixolydian is the 5th mode and G is the 5th note of the new tonality C. Aeolian is the 6th mode and G is the 6th note of the new tonality, Bb. And Locrian is the 7th mode so G is the 7th note of the new tonality, Ab.
Hope that helps!
