Songwriting is the act of combining music with lyrics (words). Different songwriters have various ways they do this. Sometimes lyrics are written first, sometimes the music comes first. One may suggest the other. Some songwriters sit down and compose the two together. Whichever method you prefer, combining music and lyrics is an artistic endeavor that can be fulfilling creatively and perhaps financially rewarding.
Develop the piece of the song you have in your mind, whether it is a lyric or a bit of music. It may be one line of the song or a whole verse that comes first. It may just be a progression of chords strummed on a guitar. If you're inspired by words, write lyrics first. If it's music, write down the basic chords on paper.
Work with what you have first. Play the chord progression a few times to make sure you have the rhythm and tempo of the song down. If you have a lyric, try singing the words you've written while you play the chords. No one can tell you exactly how those two elements will go together. Listen as you play the chords and sing the words. Change one or the other as you develop the combination. Try removing part of the lyric or changing it slightly. Try switching the rhythm of the chords you're playing or adding a chord.
Combine the chords and lyrics in your notebook when a section is complete. Write the lyrics of the song on one line. Write the chords over the lyrics, placing each chord above the word where the chord begins. When part of your song is set, go back and work on the rest. Try writing another verse or chorus. Change the melody by trying new chords.
Record your song when you're finished. Play and sing it as you've written it. Make any changes that might be suggested as a result of playing the chords and lyrics together. Songwriting is a personal artistic medium. In the end, your ear will tell you if what you've written is pleasing.
While basic songwriting can be accomplished by beginners, it is a good idea to further your understanding of various instruments and more complex musical theory. This can help you improve as a songwriter over time. Consider using various instruments to write your songs. Some songwriters find that using different instruments encourages writing a wider variety of song genres. Keep a notebook for your ideas. Jot down lyrics, music, phrases, themes and experiences for future use.