Regardless of your level of musicianship, several methods of creating tunes for a song exist. If you have knowledge of music notation and can play piano, there are some tricks to making sure your melody makes logical sense and sounds pleasing to the ear. If you have no experience, methods exist to help you quickly set your words to music and create a song. Pick the approach that works best for you -- and get to work -- making up a tune for your song.
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.
If you have no experience with writing music and can't read music, try taking a pre-existing melody and memorizing it. Then, you can modify the melody to make it original and apply your own lyrics to the tune. This makes it possible to write music completely by ear, without having the need to write your own music. Hire a transcriber to notate your melody for posterity.