Learn about note values, if you don't already know how to write music. Start a metronome and begin by tapping along with the beat to create quarter notes. Quarter notes have black note-heads with a single stem. Half notes fall on every other beat and looks like a quarter note, but has a hollow circle for a note-head. Whole notes occupy four beats and look like half notes without stems. Eighth notes occur twice per beat and look like a quarter note with a flag coming off the top.
Write to the rhythm of the lyrics. Speak the lyrics out loud and tap out a rhythm to match the lyrics. For instance, the phrase, "the cat was broken" might use the following rhythm: two eighths, one quarter and two eighth notes. The two eighths would line up with "the cat," the quarter would line up with the word "was" and the last two eighths line up with "bro-ken."
Create a tune by moving in stepwise motion. Avoiding leaps and skips in the music will make the tune easier to sing and avoid problems with odd melodies.
Study music theory and piano to increase your knowledge of how to write your own melodies. When using a piano to write music, try and keep the tune within a fifth. This will make the melody easier to sing.