Writing a song is not like following a well marked trail, there are literally hundreds of ways you can go. However, the western musical scale only has twelve notes and the majority of songs have only a few chords. But that framework has produced millions of songs.
A songwriter gets a hint of a musical or lyrical idea and takes it somewhere. Being a songwriter I have often sought after information that would help me in my endeavors. I have found four methods for writing songs
Pure inspiration: This is the luckiest and easiest method. The words and music come at the same time. Generally the songwriter hears the song in her mind and grabs an instrument. The entire song comes fast and furious. It feels like it was given to you.
Words first: The idea for lyrical content is there and a poem is written. The cadence and meter of the lyric drive how the music must follow. Often times the song writer has to modify the lyrics in the chorus or bridge to help make sense of how the music matches.
Music first: The songwriter has a great musical idea and a general framework of the song. Then the words come. Many songwriters write lyrics or phrases that they will reference in times like this. The songwriter searches for a lyric that matches the mood or vibe of the song.
Potpourri: Lastly the writer might have a hook or chorus complete with word and music but needs the rest of the song. During the songwriting process they have to mine the feeling of what is already written to write the other parts of the song. I essentially built the song “From the Mountain” using this method.
There you have it. These are the most common methods I have found for writing songs.