For beginners two methods seem to work pretty well:
1. the note for note method:
start singing the first two notes and repeat them for several times until you can hear and sing them in your head without singing them aloud.
The continue with three notes, with 4 and so on.
c, d c,d,c d,c d,c,d
c,d,e c,d,e,d,c e,d,c e,d,c,d,e
and so on with 4, 5, 6 notes until you have the full scale
or (adds the diatonic intervalls):
c,d,e c,d,e,c e,d,c e,d,c,e
c,e c,e,d,c e,c e,c,d,e
go slowly and check the correct pitch on an instrument. It does not have to be in time, so don't use a metronome. You could also try to practise singing an improvisation only with the first 2 or 3 notes until you feel comfortable with them e.g. c, c, c, d, d, c, c, d,c d,c,d,d,c,d,d,d,c ...............
2. The Tetrachord method:
each scale consists (there is always an exception to everything) of two tetrachords (4 notes of the scale).
the c majore scale consists of the tetrachords c,d,e,f and g,a,h,c.
Both have the same intervalconstruct. There are several different tetrachords with different intervalconstructs which if put together form different scales (you should find 4 different constructs of tetrachords regarding only the scale system derived from major).
Learn to sing, hear and to use them in each direction.