Example, when playing A major, you can start the scale on A or F#, which is the relative minor for A. When you change to D Major, you can stay on A, or move to D, which changes the mode to Lydian, or you can use B, which is the relative minor of D, which changes the mode to Dorian.
I would strongly recommend that you read up on using modes and scales in general.