When it comes to writting a melody, use the C major scale starting with either the first note C, known as the root. Or the fifth note G, known as the dominant. End the diddy you come up with on C.
That's your first step in using scales, it's a pretty easy practice. Once you get through it you should see how scales and songs work. Of course you don't always have to use the C major scale, any scale or mode is roughly the same when it comes to the two above exercises. But the scale must have the same root as the chord progression, and the chord progression should be made of the chords in that scale. The second part about melody will eventually breakdown, but it's a good first step because 1) it always works and 2) its the fundamental idea of how melodies and harmony (chord progression) are constructed together.
"My whole life is a dark room...ONE BIG DARK ROOM" - a.f.i.