Some people write poems first and put the poems to music. Other people write the music first and the find the words to fit the music. I typically do the latter. I start with a hook which is a catchy piece of music, and come up with an intro, melody and chorus. thrown in a bridge, coda and ending. Once I get the basic music form down then I find the words that the music inspires. But it's a creative process and there isn't just one way to make music, this is just the process that I find works for me.