The sheet below outlines the keys of C major and A minor (and their relevant pentatonic friends). This is a good place to start writing melodies from. Largely because we can avoid those troublesome black note on the keyboard.
Here is a great example of a simple but effective melody. Great use of rhythm here..
Remember most melodies, like this one are a collection of short phrases that are repeated and then slightly changed. Wonderwall has a two bar phrase that is repeated (with different words) and then develops into a slightly higher range to finish off the first half of the verse melody - this is a very common melodic structure in songwriting.
Melody Writing 1